Versioning — how to modify Flow code
Running Flows continue after you deploy new Worker code. Change code carefully so in-flight executions do not observe incompatible Step graphs.
Principles
- Prefer additive changes — new Steps, new RPCs, new optional Attributes
- Do not remove or rename Step types still referenced by open Flows
- Keep WaitFor/Execute contracts stable for existing Step types (inputs/outputs)
- Use new Step types for incompatible logic; route only new executions there
- When a bug leaves Flows stuck, fix forward then reset from a safe point
Safe patterns
- Add a new Step and branch to it only for new Attribute/flag values
- Keep old Step implementations until all old runs complete
- Version RPC names rather than silently changing request schemas
Unsafe patterns
- Deleting a Step type that open Flows still move to
- Changing the meaning of an Attribute without migration
- Assuming no long-running executions exist
Continues and resets
Very long Flows may continue-as-new. Resets jump execution to an earlier Step after a code fix. Combine with monitoring from Application operations.