For AI agents: the complete documentation index is available at https://a3s-lab.github.io/Flow/v1.0.0/en/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/Flow/v1.0.0/en/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/Flow/v1.0.0/en/nodes/continue-as-new.md.

Continue as new flow.continue-as-new

A continue-as-new node closes the current history segment and creates a successor run for the same workflow. It fits long polling, paged processing, recurring maintenance, and any process that must bound history per segment. The old run commits a continued outcome. The successor inherits workflow definition, runtime build, and patch markers, then enters through the normal start node.

Successor input

The input expression creates start data for the next run. Paged work should carry a stable cursor, references to accumulated results, and every confirmed business value needed to resume. Do not rely on a process-local counter or current page position. Keep the new input small but complete so the successor can recover independently and its audit trail explains where it resumed.

The successor port describes authoring intent. The closed run does not continue through that port as ordinary control flow. The engine rejects continuation while unconsumed signals remain, which prevents an already received business message from disappearing across the boundary. Cancellation cleanup cannot create a successor. Use a child workflow when work should branch into an independently managed parallel run.

History and release checks

Test cursor boundaries, empty and final pages, repeated continuation requests, a process exit before successor creation, and linkage between the two runs. Monitoring should group segments under one business chain while showing each segment ID. When deploying a new build, confirm that the successor routes to a compatible worker and that old segments retain the code required to replay their committed history.

Use it to close the current history segment and create a successor with new input. It fits long polling, paged processing, and flows that must bound segment history.

Runtime behavior

The successor inherits workflow definition, runtime build, and patch markers. The successor port expresses graph intent; the closed run does not continue executing.

Node contract

Type
flow.continue-as-new
Role
Durable runtime command
Runtime binding
continue_as_new
Durable identity
Defined by graph structure

Configuration properties

PropertyType and controlDefaultRules
inputSuccessor inputdictA3SFlowExpressionInput{"apiVersion":"a3s.dev/flow-expression/v1","expression":{"op":"field","path":"input"}}Initial JSON input supplied to the successor run.Required

Ports

DirectionPort IDKindValue types
InputinIncontrolFlowControl
OutputsuccessorSuccessorcontrolFlowControl

Node JSON example

The CLI creates the same structure from manifest defaults. Canvas position, title, and selection are presentation data.

workflow.json
{
  "position": {
    "x": 320,
    "y": 160
  },
  "id": "example-flow-continue-as-new",
  "data": {
    "input": {
      "apiVersion": "a3s.dev/flow-expression/v1",
      "expression": {
        "op": "field",
        "path": "input"
      }
    },
    "type": "flow.continue-as-new"
  }
}

CLI usage

Inspect the installed manifest first, then create the node and validate the complete workflow. Every command emits JSON.

Terminal
a3s-flow node flow.continue-as-new --pretty
a3s-flow new flow.continue-as-new --id example-flow-continue-as-new --pretty
a3s-flow validate workflow.json --pretty
a3s-flow compile workflow.json --pretty
a3s-flow digest workflow.json --pretty

Skill usage

The package includes the a3s-flow Skill. It queries the CLI catalog before creating, validating, compiling, and digesting a workflow.

Prompt
Use $a3s-flow to add the "flow.continue-as-new" node to workflow.json, connect valid ports, and validate the result.

CLI usage · Skill usage

Operational notes

  • Carry a deterministic cursor and accumulated state in the new input.
  • A run cannot continue while signals remain unconsumed.
  • Cancellation cleanup cannot create a successor run.