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 9, 2026.

View as Markdown

You, to your agent: 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
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·month and €8.50 per GiB·monthapps by usage, caches by reservation

Guides

Connect your agent, it takes care of the rest

To paste into your agent

Read while.sh/agents, then deploy my app with while.

Copy the instructions

No account needed to try: your app is live right away. To keep it, sign in.

A project for your company? Talk to the team: hello@while.sh