Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
[email protected]
Patch Changes
#799
d1a0c2bThanks @threepointone! - feat: Add Cloudflare Workflows integration for AgentsAdds seamless integration between Cloudflare Agents and Cloudflare Workflows for durable, multi-step background processing.
Why use Workflows with Agents?
Agents excel at real-time communication and state management, while Workflows excel at durable execution. Together:
AgentWorkflow Base Class
Extend
AgentWorkflowinstead ofWorkflowEntrypointto get typed access to the originating Agent:Agent Methods
runWorkflow(workflowName, params, options?)- Start workflow with optional metadata for queryingsendWorkflowEvent(workflowName, workflowId, event)- Send events to waiting workflowsgetWorkflow(workflowId)- Get tracked workflow by IDgetWorkflows(criteria?)- Query by status, workflowName, or metadatadeleteWorkflow(workflowId)- Delete a workflow tracking recorddeleteWorkflows(criteria?)- Delete workflows by criteria (status, workflowName, metadata, createdBefore)approveWorkflow(workflowId, data?)- Approve a waiting workflowrejectWorkflow(workflowId, data?)- Reject a waiting workflowAgentWorkflow Methods
On
this(non-durable, lightweight):reportProgress(progress)- Report typed progress object to AgentbroadcastToClients(message)- Broadcast to WebSocket clientswaitForApproval(step, opts?)- Wait for approval (throws on rejection)On
step(durable, idempotent):step.reportComplete(result?)- Report successful completionstep.reportError(error)- Report an errorstep.sendEvent(event)- Send custom event to Agentstep.updateAgentState(state)- Replace Agent state (broadcasts to clients)step.mergeAgentState(partial)- Merge into Agent state (broadcasts to clients)step.resetAgentState()- Reset Agent state to initialState (broadcasts to clients)Lifecycle Callbacks
Override these methods to handle workflow events (workflowName is first for easy differentiation):
Workflow Tracking
Workflows are automatically tracked in
cf_agents_workflowsSQLite table:metadatafield for queryable key-value dataSee
docs/workflows.mdfor full documentation.#781
fd79481Thanks @HueCodes! - fix: properly type tool error content in getAITools#811
f604008Thanks @threepointone! - ### Secure Email Reply RoutingThis release introduces secure email reply routing with HMAC-SHA256 signed headers, preventing unauthorized routing of emails to arbitrary agent instances.
Breaking Changes
createHeaderBasedEmailResolverremoved: This function now throws an error with migration guidance. It was removed because it trusted attacker-controlled email headers for routing.Migration:
createAddressBasedEmailResolver(agentName)createSecureReplyEmailResolver(secret)with signed headersEmailSendOptionstype removed: This type was unused and has been removed.New Features
createSecureReplyEmailResolver: A new resolver that verifies HMAC-SHA256 signatures on incoming emails before routing. Signatures include a timestamp and expire after 30 days by default.signAgentHeaders: Helper function to manually sign agent routing headers for use with external email services.replyToEmailsigning: ThereplyToEmailmethod now accepts asecretoption to automatically sign outbound email headers.If an email was routed via
createSecureReplyEmailResolver, callingreplyToEmailwithout a secret will throw an error (pass explicitnullto opt-out).onNoRoutecallback:routeAgentEmailnow accepts anonNoRoutecallback for handling emails that don't match any routing rule.#800
a54edf5Thanks @threepointone! - Update dependenciesUpdated dependencies [
77be4f8,a54edf5,99cbca0]:@cloudflare/[email protected]
Patch Changes
#797
77be4f8Thanks @iTrooz! - refactor(ai-chat): put SSE reply and plaintext reply logic into 2 separate functions#800
a54edf5Thanks @threepointone! - Update dependencies#795
99cbca0Thanks @Jerrynh770! - Fix resumable streaming to avoid delivering live chunks before resume ACKUpdated dependencies [
d1a0c2b,fd79481,f604008,a54edf5]:@cloudflare/[email protected]
Patch Changes
#800
a54edf5Thanks @threepointone! - Update dependenciesUpdated dependencies [
d1a0c2b,fd79481,f604008,a54edf5]:[email protected]
Patch Changes
#800
a54edf5Thanks @threepointone! - Update dependenciesUpdated dependencies [
d1a0c2b,fd79481,f604008,a54edf5]: