Skip to content

Durable tasks

A durable task (“fiber”) is started from a project’s Fibers page, or with POST /api/projects/:id/fibers {name, input, wake_at?}. Writers start and cancel them; readers see them. Each step’s result is kept, a task resumes where it was after a restart, and an ended one is deleted after 7 days.

Task Input Does
ping message Answers with the message and the time.
sleep_demo seconds, 1 to 60 (2) A step, a sleep, a step.
interval_task interval_seconds, 5 to 86,400 (60) Ticks, then starts the next of its chain that long after.
http_request see below Sends one request until it is answered.

A task’s input is stored as written and shown to everyone who can read the project. Do not put a secret in it, a header included. An http_request address is also kept whole in the engine’s traces, and goes wherever they are exported (observability): that includes a token in its path, as in an incoming-webhook address, or in its query.

What Limit
Input 4 KiB
Open tasks 100 a project; 1,000 over the projects one person created
Tasks started in an hour 1,000 a project; 4,000 over the projects one person created
interval_task chains FIBER_INTERVAL_MAX_PER_PROJECT a project (10); 50 over the projects one person created
wake_at at most 30 days ahead

A request over a limit is refused with 429. A chain at its limit ends without starting its next.

Input Default
url required http or https, by name
method POST not CONNECT or TRACE
headers none at most 50, strings
body none a string, or JSON sent as text; none for GET and HEAD
timeout_seconds 30 1 to 300
retries 3 0 to 10
  • Where it may go. A request to an IP address, localhost, or a name under .local, .internal, .lan, .localdomain or .home.arpa is refused when the task is started. So is one to this deployment: the host the task was started at, those in FIBER_AUTH_ORIGINS, the host of FIBER_PUBLIC_URL, and every name under each. The engine does not run http_request without FIBER_PUBLIC_URL. It has no binding to a private network, and does not resolve names itself: a Worker cannot. A public name that resolves to a private address is refused by Cloudflare before it connects; see below.
  • What it may not set. Host, Content-Length, Transfer-Encoding, Connection, Upgrade, TE, Trailer, Keep-Alive, CDN-Loop, Via, Idempotency-Key, X-Remote-Addr, X-Host, X-Original-Host, X-Original-URL, X-Rewrite-URL; any header starting CF- or Proxy-; and any whose name has a part IP or Forwarded, such as X-Real-IP, True-Client-IP or X-Forwarded-For. A value is Latin-1 text with no control character but tab.
  • Redirects are not followed: a 3xx is the answer, and fails the task.
  • Retries. A failed connection, a timeout, a 5xx or a 429 is tried again, after 1, 2, 4… seconds, at most 300. Any other answer that is not 2xx fails the task at once.
  • Once. Every attempt carries the same Idempotency-Key, a random value that only the task knows. A request can be sent twice, for example when the server restarts after sending it; a receiver that honours the key can act on it once.
  • What is kept. For each attempt, the status and the first 2,048 characters of the body. At most 16 KiB of a response is read.
  • How much. One task sends at most 33 requests: 11 attempts, each tried up to three times if the server fails while making it. With the limits above, one project can send about 33,000 an hour.

Checked 1 December 2026, on Cloudflare, from a Worker with the engine’s compatibility flags running the engine’s own parseHttpRequest and attempt. Three DNS-only A records in a Cloudflare zone pointed at 10.0.0.1, 169.254.169.254 and 127.0.0.1. Each was asked for over http and https, and at /latest/meta-data/.

Target Answer
All nine 530, error code: 1016, in 0 to 171 ms: refused before connecting
Control: a record in the same zone at a public address that is not Cloudflare’s the origin’s own 403 over http; 526 over https (its certificate is not for that name)
Control: https://example.com/ 200

The control shows a new record in that zone resolves and connects, so the refusals are for the addresses. Run again if Cloudflare’s outbound behaviour is said to change. The Worker and the records were deleted.