Skip to content

Go to the docs contents

Workers

A process that runs all the time, with no web address: it drains a job queue or follows a stream of events, and a new version replaces it without running twice.

Updated November 21, 2026.

View as Markdown

Background worker with no web address, kept running by while: gears turning inside a closed box

You, to your AI: Add a worker that sends the pending emails.

What your agent writes

Your agent writes it in while.yaml, at the root of your app:

while.yaml
apiVersion: while/v1
project: my-app
services:
  - name: jobs
    type: worker
    command: [node, worker.js]

What your app receives

Your app receives these environment variables at every deployment:

VariableWhat it holds
WHILE_SERVICEThe worker’s name.
DATABASE_URLThe address of the project’s database, if it has one.
SERVICE_<NAME>_URLThe address of the project’s other services.

When to use it

For what runs non-stop without answering requests: draining a queue, following an event stream. A worker never sleeps: for work at a fixed time, a scheduled job costs less.

How it works

A worker runs continuously, with no web address, to drain a queue or follow a stream. A new version replaces it without ever running twice.

Pricing

These prices are the same on every plan, excluding VAT:

ResourcePriceDetails
CPU and memory€17 per vCPU per month, €8.50 per GiB per monthtools by usage, caches by reservation

Guides

Give your AI the message, and it takes care of the rest

Give this to your AI

Read while.sh/agents and help me get started with while.

Copy the message

In 3 minutes, with no sign-up, the tool has its own address. To keep it, create your account.

For a company project, write to the while team: hello@while.sh