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

Run step batch flow.batch

A batch declares several host tasks that may advance independently and reports results in declaration order. It works well for a bounded, known set such as checking several records or calling a fixed group of tools. If the collection is large or must resume page by page, split it with a stable cursor or use an iteration container so each member has a clearer scope.

Member settings

Each entry in steps has step_key, step_name, input_mapping, max_attempts, retry_delay_ms, and on_exhausted. The key must be unique inside the node and combines with the graph node ID to form durable task identity. Members may finish in any order, but keys and declaration order must not be rebuilt from completion order. When a graph already has runs, preserve every member key and its semantic position.

Each input_mapping creates separate parameters and retry settings apply per member. If at least one member chooses continue_workflow, the node exposes recoverable_failure and errors so downstream logic can inspect failed members. The default fail_run closes the run when that member exhausts attempts. Host handlers still need at-least-once safety, with idempotency derived from run, node, member, and attempt identity.

Results and capacity

After every member resolves, control continues through done and results follows declaration order. Recoverable errors preserve that order as well, so array position must not be interpreted as completion time. Test empty lists, duplicate keys, partial failure, complete failure, process recovery, and large results. Store references for large outputs. Bound the batch against host concurrency, queue capacity, and tenant limits so one node cannot submit more work than downstream systems can absorb.

Use it to declare host tasks that can advance independently. Members are stored in a fixed order and keep separate names, inputs, and retry policies.

Runtime behavior

The node ID and member key form each durable step identity. The engine records the whole batch before advancing unfinished work and reports results in declaration order.

Node contract

Type
flow.batch
Role
Durable runtime command
Runtime binding
schedule_steps
Durable identity
Graph node ID plus member key

Configuration properties

PropertyType and controlDefaultRules
stepsSteps to runtableA3SFlowBatchInput[{"step_key":"member-1","step_name":"task.run","input_mapping":{"apiVersion":"a3s.dev/flow-expression/v1","expression":{"op":"field","path":"input"}},"max_attempts":3,"retry_delay_ms":0,"on_exhausted":"fail_run"}]Steps run in list order. Each member needs a stable, unique ID.Required

Steps to run

PropertyType and controlDefaultRules
step_keyStep keystringNot setUnique member key; the host combines it with the immutable batch graph node ID.Required
step_nameHandlerstringNot setRegistered host step handler.Required
input_mappingInput mappingobject{"apiVersion":"a3s.dev/flow-expression/v1","expression":{"op":"field","path":"input"}}Versioned deterministic expression resolved before scheduling.Required
max_attemptsAttemptsint3Total attempts including the first execution.Required
retry_delay_msDelay (ms)int0Durable delay between attempts.Required
on_exhaustedAfter retriesstringfail_runFail the run or continue workflow replay.Required

steps member properties

PropertyType and controlRules
step_keystringStable unique member identity within the batchRequired
step_namestringTask name registered by the hostRequired
input_mappingFlowExpressionBuilds input for this memberRequired
max_attemptsintegerTotal attempts including the first executionRequired
retry_delay_msintegerMilliseconds before the next attemptRequired
on_exhaustedfail_run | continue_workflowBehavior after retries are exhaustedRequired

Ports

DirectionPort IDKindValue types
InputinIncontrolFlowControl
InputinputInputdataJsonValue
OutputdoneDonecontrolFlowControl
OutputresultsResultsdataJsonValue[]
Outputrecoverable_failureRecoverable failurecontrolFlowControl
OutputerrorsRecoverable errorsdataString[]

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-batch",
  "data": {
    "steps": [
      {
        "step_key": "member-1",
        "step_name": "task.run",
        "input_mapping": {
          "apiVersion": "a3s.dev/flow-expression/v1",
          "expression": {
            "op": "field",
            "path": "input"
          }
        },
        "max_attempts": 3,
        "retry_delay_ms": 0,
        "on_exhausted": "fail_run"
      }
    ],
    "type": "flow.batch"
  }
}

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.batch --pretty
a3s-flow new flow.batch --id example-flow-batch --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.batch" node to workflow.json, connect valid ports, and validate the result.

CLI usage · Skill usage

Operational notes

  • Member keys must be non-empty and unique.
  • Never renumber members by completion order.
  • Window large batches with a stable cursor from workflow input.