DocsCore concepts

View as Markdown

anywhere.toml reference

Every worker is a folder with an anywhere.toml at its root. No workflow SDK or Dockerfile is needed. Workers sleep automatically as soon as their last active run finishes.

Complete example

title = "Daily error triage"
build = "npm i -g @anthropic-ai/claude-code"

[[trigger]]
name = "triage"
cron = "0 9 * * *"
timezone = "America/New_York"
run = "bash run.sh"
timeout = 1800

[[trigger]]
name = "on-issue"
webhook = true
dedupe_header = "x-github-delivery"
run = "node dist/on-issue.js"
timeout = 600

[limits]
cpu = 2
memory = "4 GiB"
disk = "20 GiB"

Put top-level keys (title, build) above the first [[trigger]] or [limits] table. TOML treats keys placed below a table header as part of that table.

Top-level keys

Key Type Description
title string Human-readable label shown in the portal and anywhere workers list.
build string Optional shell command run on Linux in /app on every deploy, without secrets. Install CLIs, npm/Python packages, or apt packages here.

[[trigger]]

Define between 1 and 16 triggers per worker using double brackets ([[trigger]]). A worker must define at least one trigger (worker_triggers_missing). Each trigger is either a cron trigger (cron, optional timezone) or a webhook trigger (webhook = true, optional dedupe_header) — never both.

Key Required Description
name Yes 1 to 32 lowercase letters, digits, and -, starting with a letter. Unique across all triggers in the worker.
run Yes Shell command executed with /bin/sh -c as root in /app. Webhook runs receive the raw body on stdin and headers in ANYWHERE_WEBHOOK_HEADERS.
timeout No Maximum seconds the run may execute, from 1 to 86400. Defaults to 1800 (30 minutes). For queued webhook runs, starts when the run leaves the queue and begins executing.
cron Cron only Standard 5-field cron at minute resolution (minute hour day month weekday). No seconds, @daily, L, W, #, or ?. Mutually exclusive with webhook.
timezone Cron only Optional IANA time zone name such as America/New_York or Europe/London. Defaults to UTC.
webhook Webhook only Set webhook = true to expose an inbound secret webhook URL via anywhere triggers url. Mutually exclusive with cron.
dedupe_header Webhook only Optional HTTP header name matched case-insensitively (for example "X-GitHub-Delivery" or "svix-id"). An absent header returns 400 dedupe_header_missing; duplicate values return 202 without queueing a second run.

[limits]

Limits cap CPU, memory, and disk for the worker’s build, runs, and exec commands. A run reserves the worker’s memory on its host when it starts, and memory is billed on that declared size while the worker is awake; CPU is billed on what the worker uses. A run that doesn’t fit on a full host waits as queued for memory until room frees.

[limits]
cpu = 2           # shared vCPUs (decimals like 0.5 are allowed)
memory = "4 GiB"  # whole MiB or GiB
disk = "20 GiB"   # whole MiB or GiB
  • Omitted memory defaults to 2 GiB, or your plan’s ceiling if that’s lower. Omitted CPU and disk default to your plan’s per-worker ceiling (1 vCPU / 10 GiB on Free; 4 vCPUs / 100 GiB on Pro and Team). Memory may go up to 2 GiB on Free and 8 GiB on Pro and Team.
  • Requesting more than your plan allows fails with limit_above_plan. Requesting [limits] above the host’s per-sandbox CPU or memory ceiling fails with worker_limits_unavailable (lower [limits] in anywhere.toml); if no host currently has room for a new worker, deploy fails with host_full.
  • The effective ceilings are exported inside every run and exec session as ANYWHERE_MEMORY_BYTES and ANYWHERE_CPUS so your code can size memory budgets and concurrency.
  • Set [limits] to what the worker actually needs so placement succeeds cleanly on hosts.
  • Disk limits can shrink as well as grow, as long as existing files fit. Otherwise deploy fails with disk_limit_below_used.

Validation and uploads

Check your anywhere.toml and selected files before deploying:

anywhere check ./my-worker

Unknown keys and invalid triggers are rejected cleanly at validation and deploy time (worker_toml_invalid, worker_triggers_missing, or worker_trigger_invalid) with a direct fix.

Uploads automatically exclude .git, .env, .env.*, and anything matched by .gitignore. Keep local node_modules/, .venv/, and live databases out of uploads so deploys never overwrite remote state in /app/data/. Upload limits are 50,000 files, 1 GiB total, and 30 MiB per file.

For agents:Markdown (/docs/anywhere-toml.md)Index (/llms.txt)