You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Add Cloudflare Workflows integration documentation for Agents
Sync documentation from cloudflare/agents PR #799
- Add comprehensive guide for Cloudflare Workflows integration with Agents
- Document new AgentWorkflow class with typed Agent access
- Add API reference for workflow tracking, progress reporting, and lifecycle callbacks
- Include patterns for background processing, human-in-the-loop, and state sync
- Update run-workflows API reference with AgentWorkflow integration
Related PR: cloudflare/agents#799
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Agents can trigger asynchronous [Workflows](/workflows/), allowing your Agent to run complex, multi-step tasks in the background. This can include post-processing files that a user has uploaded, updating the embeddings in a [vector database](/vectorize/), and/or managing long-running user-lifecycle email or SMS notification workflows.
11
+
Agents can trigger asynchronous [Workflows](/workflows/), allowing your Agent to run complex, multi-step tasks in the background. This can include post-processing files that a user has uploaded, updating the embeddings in a [vector database](/vectorize/), and managing long-running user-lifecycle email or SMS notification workflows.
12
12
13
-
Because an Agent is just like a Worker script, it can create Workflows defined in the same project (script) as the Agent _or_ in a different project.
13
+
The Agents SDK provides two ways to work with Workflows:
14
+
15
+
1.**Basic integration** - Trigger workflows from Agents like any Worker script
16
+
2.**AgentWorkflow integration** - Extended workflow class with typed Agent access, automatic tracking, progress reporting, and bidirectional communication
17
+
18
+
For comprehensive documentation on the AgentWorkflow integration, refer to [Integrate Cloudflare Workflows with Agents](/agents/guides/cloudflare-workflows-integration/).
14
19
15
20
:::note[Agents vs. Workflows]
16
21
17
22
Agents and Workflows have some similarities: they can both run tasks asynchronously. For straightforward tasks that are linear or need to run to completion, a Workflow can be ideal: steps can be retried, they can be cancelled, and can act on events.
18
23
19
-
Agents do not have to run to completion: they can loop, branch and run forever, and they can also interact directly with users (over HTTP or WebSockets). An Agent can be used to trigger multiple Workflows as it runs, and can thus be used to co-ordinate and manage Workflows to achieve its goals.
24
+
Agents do not have to run to completion: they can loop, branch and run forever, and they can also interact directly with users (over HTTP or WebSockets). An Agent can be used to trigger multiple Workflows as it runs, and can thus be used to coordinate and manage Workflows to achieve its goals.
20
25
21
26
:::
22
27
@@ -106,3 +111,82 @@ You can also call a Workflow that is defined in a different Workers script from
106
111
</WranglerConfig>
107
112
108
113
Refer to the [cross-script calls](/workflows/build/workers-api/#cross-script-calls) section of the Workflows documentation for more examples.
114
+
115
+
## AgentWorkflow integration
116
+
117
+
For advanced workflow integration with automatic tracking, progress reporting, and bidirectional communication, use the `AgentWorkflow` class:
0 commit comments