Back
Cloudflare Agents SDK: designing background tasks
TechCloudflareAI agentsCloud

Cloudflare Agents SDK: designing background tasks

Novoid

Work that takes time

On 26 June 2026, Cloudflare introduced an Agents SDK update with detached background sub-agents and a unified runTurn entry point. This concerns work lasting longer than a simple interactive exchange.

Describe the complete lifecycle

For an assistant analyzing a folder, we would begin with understandable states: queued, running, completed and failed. Users need to know whether a result is still expected and how to retrieve one already produced.

Long-running work also raises design questions. What happens when the page closes, the network disconnects or the same request arrives twice? Describe these scenarios before evaluating recovery behavior. Displayed status must be traceable to the effects actually performed.

Set an explicit budget

We recommend bounding processing time, tool calls and spending. A task that keeps running unattended does not automatically become useful. A representative trial should include cancellation and recovery, with traces detailed enough to explain the outcome.

Official source.

Retrospective watch — June 2026.