Uh oh!
There was an error while loading. Please reload this page.
docs(cookbook): add Upgrading Workflows guide - #1874
Conversation
# Conflicts: # docs/content/docs/v4/cookbook/advanced/upgrading-workflows.mdx
- Add v5 variant of the cookbook page that calls start() directly from the workflow body (v5 supports workflow-context start; v4 keeps the step-wrapped pattern from #1491). - Register the page in v5 cookbook sidebar (meta.json) and the v5 cookbook landing index. - Add a "see also" callout and /docs/foundations/versioning to the related list in both v4 and v5, to complement the foundational versioning docs added in #2010. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
VaguelySerious
left a comment
There was a problem hiding this comment.
AI review: no blocking issues
Polished the PR on top of the original commit:
- Ported the page to the v5 content tree (direct workflow-context
start()per #1491; v4 keeps the step-wrapped pattern as written) - Cross-linked to
/docs/foundations/versioning(added in #2010 since this PR was opened) — Method 1 here is the hook-driven analog of versioning.mdx'ssleep-based "Self upgrading workflows"; Method 2 (dedicatedupgradeHook) is fully unique - Registered the page in the v5 cookbook sidebar (
meta.json) and landing index - Added an empty changeset
Verified both /cookbook/advanced/upgrading-workflows (v4) and /v5/cookbook/advanced/upgrading-workflows render with all sections in a local dev server. Docs CI checks (Docs Code Samples, Docs Links, Docs Preview Smoke Checks, Tarballs Preview Smoke Checks) all green.
Uh oh!
There was an error while loading. Please reload this page.
No backport to The substantive content of this commit is a new cookbook guide added under To override, re-run the Backport to stable workflow manually via |
Summary
Adds a new advanced cookbook page —
/cookbook/advanced/upgrading-workflows— for handling long-running workflows that need to pick up shipped fixes without migrating in-flight runs.The guide is built around a single principle: identify a clean upgrade point in the workflow (a moment where state can be checkpointed and a new run started fresh) and call
start()withdeploymentId: "latest"to hand off to whatever deployment is current.It documents two methods:
upgradeHook. A separate endpoint resumes the upgrade hook (e.g. from a control plane after a deploy), at which point the workflow checkpoints state and respawns on the latest deployment. Best when iterations are infrequent/expensive or when "upgrade" should be an explicit operation that can be fanned out across a fleet.Both methods share the same "How it works" section (the
deploymentId: "latest"knob,start()from a step, state-via-argument, per-run hook tokens) and Caveats (backward-compat constraints, stable workflow identity, hook-not-found gap between iterations, plus a Method-2-specific note on tracking active runs).Files changed
docs/content/docs/cookbook/advanced/upgrading-workflows.mdx— new guidedocs/content/docs/cookbook/advanced/meta.json— adds the slug to the Advanced sectiondocs/lib/cookbook-tree.ts— adds the page to the cookbook sidebar (slug → category map andrecipesentry)docs/content/docs/cookbook/index.mdx— adds a link from the cookbook landing pageTest plan
pnpm dev(docs) and visit/cookbook/advanced/upgrading-workflows— page renders with both Method 1 and Method 2 sections, anchor links work/cookbook) lists "Upgrading Workflows" under AdvancedMade with Cursor