Skip to content

Commit b8f46bf

Browse files
Add Cloudflare Workflows integration guide for Agents
- Add comprehensive guide for integrating Cloudflare Workflows with Agents SDK - Demonstrate durable execution, human-in-the-loop approval, and scheduled tasks - Include complete working examples with TypeScript code - Update workflows concept doc with integration overview and cross-references - Document when to use ctx.waitUntil() vs Cloudflare Workflows Related to cloudflare/agents PR #683 (add task management and workflow integration) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent cbeb812 commit b8f46bf

File tree

2 files changed

+745
-0
lines changed

2 files changed

+745
-0
lines changed

src/content/docs/agents/concepts/workflows.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,23 @@ Workflows manage how external tools and services are accessed. They handle authe
2929
The workflow maintains the state of ongoing processes, tracking progress through multiple steps and ensuring consistency across operations.
3030
4. **Output Handling**
3131
Results from the agent's actions are processed according to defined rules, whether that means storing data, triggering notifications, or formatting responses.
32+
33+
## Cloudflare Workflows integration
34+
35+
The Agents SDK can be integrated with [Cloudflare Workflows](/workflows/) to enable durable, long-running tasks that go beyond what is possible with standard Durable Objects. Cloudflare Workflows provide:
36+
37+
- **Durable execution** that survives restarts, deployments, and failures
38+
- **Automatic retries** with configurable backoff strategies
39+
- **Step-based checkpointing** to avoid re-executing completed work
40+
- **Long-running operations** that can span hours or days
41+
- **Hibernation** with `step.sleep()` to pause execution without compute costs
42+
- **Human-in-the-loop approval** with `step.waitForEvent()` to pause indefinitely
43+
44+
When building with Agents, you can dispatch workflows from Agent methods and receive updates via RPC callbacks. This enables patterns like:
45+
46+
- Background analysis tasks that run for extended periods
47+
- Multi-phase operations with human approval gates
48+
- Scheduled follow-up tasks that trigger after delays
49+
- Resilient data processing pipelines with automatic retry logic
50+
51+
To learn how to integrate Cloudflare Workflows with your Agent, refer to the [Workflows integration guide](/agents/guides/workflows-integration/).

0 commit comments

Comments
 (0)