Completes the current workflow execution and immediately starts a new
execution of the same workflow with the provided arguments. The execution
history is reset, preventing unbounded state growth in long-running
workflows.
continueAsNew never returns — it always throws an internal interruption
error that the engine catches to orchestrate the restart. Any code after
the call is unreachable.
When to Use
Use continueAsNew for workflows that would otherwise run indefinitely
and accumulate unbounded replay history:
Completes the current workflow execution and immediately starts a new execution of the same workflow with the provided arguments. The execution history is reset, preventing unbounded state growth in long-running workflows.
continueAsNewnever returns — it always throws an internal interruption error that the engine catches to orchestrate the restart. Any code after the call is unreachable.When to Use
Use
continueAsNewfor workflows that would otherwise run indefinitely and accumulate unbounded replay history:Examples