Run a background worker with BullMQ, Celery or Sidekiq, with your AI (2026)
Sending emails, running exports and heavy processing don’t belong in your requests. Connected to while over MCP, your AI deploys the worker that handles them in the background, with its queue.
By Aloïs Oddon, co-founder of Nextmap. Facts checked on November 19, 2026.
The short version. Over MCP, your AI deploys the worker that processes your BullMQ, Celery or Sidekiq queue, with its Redis-compatible cache. What matters, like deleting a database, waits for a person’s approval.
Prerequisites
- An app that puts tasks in a queue: BullMQ, Celery, RQ or Sidekiq.
- An AI that works in a terminal: Claude Code, Codex, Cursor or Gemini CLI.
Step 1: Give your AI this message
Open your AI in your app’s folder, and paste this message into it:
Connect to while with my account (while.sh/agents), then put my app on while.
Your AI adds while’s MCP server itself. If it asks you to, restart it. On the first call to while, a page opens in your browser. In Claude Code, if it doesn’t open, type /mcp, choose while, then Authenticate. On that page, choose “A new app”, then click Authorize.
Step 2: Open your app
Your AI gives you your app’s address, for example https://mon-appli.while.cloud, over HTTPS.
What your AI does
It adds the worker and its queue to while.yaml:
apiVersion: while/v1
project: mon-appli
services:
- name: web
port: 3000
- name: worker
type: worker
command: [node, worker.js]
caches:
- name: file
durable: true
The worker runs nonstop, with no public address, and with the same code as your app. Its queue lives in a durable Redis-compatible cache: nothing is lost on restart. Its address, password included, arrives in REDIS_URL, as in this BullMQ worker1:
import { Worker } from 'bullmq';
import IORedis from 'ioredis';
const connection = new IORedis(process.env.REDIS_URL, { maxRetriesPerRequest: null });
new Worker('emails', async (job) => {
await envoyerEmail(job.data);
}, { connection });

Run a Celery worker
You, to your AI: Add a Celery worker for the exports.
Your AI declares the worker with the command celery -A monappli worker, connected to the same cache: it gives REDIS_URL to Celery, with broker=os.environ['REDIS_URL'].
See what your worker is doing
You, to your AI: Why are the emails going out late?
Your AI reads the worker’s logs in while, finds the task that is stuck and fixes it.
Add memory
You, to your AI: Give the exports worker more memory.
Your AI changes resources in while.yaml, and the worker restarts with it on the next deployment.
Go back to the previous version
You, to your AI: Go back to the previous version of the worker.
The previous version of the worker resumes in a few seconds. Your AI reads the error in the logs, fixes it and deploys again.
In the docs: Worker, Valkey cache (Redis), Scheduled jobs and Versions and rollback.
Next steps
Sources
- BullMQ, workers, accessed November 2, 2026