Skip to main content
Reference vendor/cloudflare 2 min read

workflows

On this page

Workflows Integration

Use Agents for interactive communication and state management. Add a Workflow when a task needs durable multi-step execution, independent retries, or waits for external approval. Choose based on recovery needs; consult Run Workflows before implementing the integration.

Read for the task

TaskDocumentation
Define a typed AgentWorkflow, start it from an Agent, and configure bindingsQuick start
Call back into the originating Agent and understand durable versus non-durable helpersAgentWorkflow class
Send events, query instances, pause, resume, terminate, or delete tracked workflowsAgent workflow methods
Receive progress, completion, errors, and custom eventsLifecycle callbacks
Approve or reject a waiting taskHuman-in-the-loop approval
Persist Workflow results into Agent stateState synchronization
Define steps, parameters, retries, and returned valuesWorkers API

Design checks

Keep external side effects within durable steps, make retried operations idempotent, and persist the values needed after recovery through step results. Use the Rules of Workflows to choose step boundaries.

Progress reports and client broadcasts may repeat on retry. Use the documented durable step helpers for persistent Agent state changes and completion reporting; see bidirectional communication.