7.4 Modes: serial, parallel, conditional, tee/teeWait

A pipeline (or subpipeline) has a mode that decides how its steps relate. The default is serial. Modes combine with the fail/succeed actions to control flow.

serial (default)

Steps run in order, each acting on the in-flight message left by the previous one (7.3). This is the everyday mode: fetch, decide, act, reshape.

parallel

Every step runs concurrently over a copy of the input, and the results join into one object keyed by each step's name (or its index if unnamed):

{ "mode": "parallel",
  "steps": [
    { "call": { "method": "GET", "url": "/data/customers/${order.customerId}" }, "name": "customer" },
    { "call": { "method": "GET", "url": "/stock/check" }, "name": "stock" }
  ],
  "join": "jsonObject" }

Result: { "customer": …, "stock": … }. Parallel mode forces onFail: "stop".

conditional

The first step whose if passes runs, and its result ends the pipeline; no match passes the message through unchanged. This is a switch/case over the in-flight message:

{ "mode": "conditional",
  "steps": [
    { "if": "status == 404", "call": { "method": "POST", "url": "/create" } },
    { "if": "ok",            "transform": "$" }
  ] }

tee / teeWait

A tee step runs a branch over a copy of the message and the original continues immediately — fire-and-forget side effects (logging, notifications) that don't block the main flow. teeWait is the same but completes the branch first, discarding its result before continuing. Use teeWait when the side effect must finish before you proceed but its output is irrelevant.

Fail and succeed actions

onFail (default next; parallel forces stop) decides what a failing step does to the flow:

Action Effect
stop Abort the pipeline with the failing message
next Continue with the failing message
end Exit this pipeline with the failing message

onSucceed: "end" exits after the first success. In a nested subpipeline, end/stop are local to that subpipeline — they don't unwind the parent.

These actions are also expressible in the DSL mode token: "serial stop end" sets mode serial, onFail: stop, onSucceed: end.

Next: the condition grammar used by if and conditional mode.


Previous: 7.3 Step kinds · Manual home · Next: 7.5 Conditions, interpolation, variables →