Skip to content

Conversation

@whoiskatrin
Copy link
Contributor

@whoiskatrin whoiskatrin commented Nov 27, 2025

Addded task-runner example here

Shows how to run long-running background tasks from an Agent using Cloudflare Workflows.

Two patterns demonstrated:

  • Quick analysis - runs in the Agent, good for fast tasks (<30s)
  • Deep analysis - runs in a Workflow, durable with automatic retries
    The workflow sends progress updates back to the Agent, which syncs to connected clients via WebSocket.

Files:

  • examples/task-runner/src/server.ts - Agent that dispatches to workflows
  • examples/task-runner/src/workflows/analysis.ts - Durable workflow with step-based checkpointing
  • examples/task-runner/src/App.tsx - React UI with real-time progress

@changeset-bot
Copy link

changeset-bot bot commented Nov 27, 2025

⚠️ No Changeset found

Latest commit: 80fbcd1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 27, 2025

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/agents@683

commit: 80fbcd1

@claude

This comment was marked as outdated.

agents-git-bot bot pushed a commit to cloudflare/cloudflare-docs that referenced this pull request Nov 27, 2025
This syncs documentation from cloudflare/agents PR #683 which adds a task management system with lifecycle tracking to the Agents SDK.

Changes include:
- New concept page explaining tasks and their lifecycle
- API reference documentation for the Tasks API
- Tutorial guide for building a task-based agent
- Examples of using @task() decorator and TaskContext
- Client-side task tracking with useTask() hook

Related PR: cloudflare/agents#683
@claude

This comment was marked as outdated.

@whoiskatrin whoiskatrin changed the title add task management system with lifecycle tracking add task management and workflow integration Dec 14, 2025
agents-git-bot bot pushed a commit to cloudflare/cloudflare-docs that referenced this pull request Dec 14, 2025
Syncs documentation from cloudflare/agents PR #683
cloudflare/agents#683

Adds comprehensive documentation for the task system including:
- Tasks: Tracked background operations with progress updates
- Durable Tasks: Long-running operations backed by Cloudflare Workflows

New pages:
- /agents/api-reference/tasks/ - Task decorator, TaskContext API, and client updates
- /agents/api-reference/durable-tasks/ - Durable task setup, workflow context methods, and custom workflows
… provides retry semantics, use AgentWorkflow for fine-grained checkpoints
agents-git-bot bot pushed a commit to cloudflare/cloudflare-docs that referenced this pull request Dec 14, 2025
Syncs documentation for cloudflare/agents PR #683 which adds:
- @task() decorator for tracked background operations
- Task management API (get, list, cancel, delete)
- Durable tasks with Cloudflare Workflows integration
- Real-time task updates via WebSocket

Related to: cloudflare/agents#683
@whoiskatrin whoiskatrin marked this pull request as ready for review December 29, 2025 16:46
agents-git-bot bot pushed a commit to cloudflare/cloudflare-docs that referenced this pull request Dec 29, 2025
Documents the new @task() decorator and workflow integration features
added in cloudflare/agents PR #683. Includes:

- Comprehensive guide for integrating Cloudflare Workflows with Agents
- Comparison of ctx.waitUntil() vs Workflow approaches
- Complete example with React client and real-time progress updates
- Configuration and deployment instructions

Related PR: cloudflare/agents#683

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
agents-git-bot bot pushed a commit to cloudflare/cloudflare-docs that referenced this pull request Dec 29, 2025
Documents how to integrate Cloudflare Workflows with Agents SDK for running long-running background tasks. Covers both quick analysis (Agent-based) and deep analysis (Workflow-based) patterns with real-time progress tracking.

Based on PR #683: add task management and workflow integration
cloudflare/agents#683

Generated with Claude Code https://claude.com/claude-code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant