Skip to content

Pass Workflow retention through Agent.runWorkflow() so that tracking expiry matches instance state#1948

Draft
ericclemmons wants to merge 1 commit into
codex/workflow-tracking-retentionfrom
codex/workflow-retention-tracking
Draft

Pass Workflow retention through Agent.runWorkflow() so that tracking expiry matches instance state#1948
ericclemmons wants to merge 1 commit into
codex/workflow-tracking-retentionfrom
codex/workflow-retention-tracking

Conversation

@ericclemmons

Copy link
Copy Markdown
Member

tl;dr – Pass Workflow instance retention through Agent.runWorkflow() and apply the same terminal-outcome policy to local tracking expiry.

Agent.runWorkflow() currently cannot configure the platform retention supported by Workflow.create(), so callers must choose between automatic Agent tracking and custom Workflow retention.

This adds the correctly typed retention option, forwards it unchanged, stores normalized success and error retention for Agent SQLite tracking, and derives expires_at from the eventual outcome. Successful runs use successRetention; errored and terminated runs use errorRetention. Omitted values retain platform defaults while Agent tracking uses the bounded 30-day fallback from PR 1.


References: PR 1, WorkflowInstanceCreateOptions

@changeset-bot

changeset-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c5acfeb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
agents Minor
@cloudflare/agent-think Patch

Not sure what this means? Click here to learn what changesets are.

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

@pkg-pr-new

pkg-pr-new Bot commented Jul 14, 2026

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@1948

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@1948

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@1948

create-think

npm i https://pkg.pr.new/create-think@1948

hono-agents

npm i https://pkg.pr.new/hono-agents@1948

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@1948

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@1948

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@1948

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@1948

commit: c5acfeb

@ericclemmons ericclemmons self-assigned this Jul 14, 2026
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