Condition flow.condition
A condition selects one control path from data that is already committed. It is appropriate for order state, review decisions, thresholds, and results returned by earlier tasks. The node does not call a remote service and must not read a fresh clock, random value, or mutable process state. If a decision needs external information, obtain it in a task first, commit the result, and then evaluate that result here.
Input and expression
input holds the current value and may be replaced by a value connected from an upstream data port. expression uses the bounded expression format to read workflow input, the current value, or saved results. Test true, false, missing-field, empty-collection, and wrong-type cases before publication. A large business rule is easier to operate when split across clearly named conditions, because history and graph structure then show which decision was made at each point.
matched_label and otherwise_label change canvas copy only. The stable handles remain matched and otherwise. Editing labels does not alter connection identity, while editing the expression changes execution semantics. Both control outputs should lead somewhere explicit. When one branch ends the business process immediately, connect it to the intended complete, fail, cancel, or timeout node rather than leaving it open.
Wiring and diagnosis
Connect incoming control to in and optional upstream data to value. A true expression opens matched; every other valid result opens otherwise. Tests should prove that both branches can reach a terminal outcome and that no downstream edge loops back to the condition. If validation reports an expression path, inspect the upstream result shape and confirm whether the value connection overrides the local input value.
Use it to choose between two control branches from workflow data. The expression may read start input or an upstream data port; branch labels affect presentation only.
Runtime behavior
The condition evaluates during deterministic graph execution and does not call a host task. A true result selects matched; every other result selects otherwise.
Node contract
- Type
flow.condition- Role
- Control flow
- Runtime binding
Host compilation- Durable identity
- Defined by graph structure
Configuration properties
| Property | Type and control | Default | Rules |
|---|---|---|---|
inputInput | dictJSONInput | {} | Current value to evaluate, or data connected from an upstream node.Optional · Advanced |
expressionCondition | dictA3SFlowExpressionInput | {"apiVersion":"a3s.dev/flow-expression/v1","expression":{"op":"eq","left":{"op":"field","path":"input.approved"},"right":{"op":"literal","value":true}}} | Evaluate workflow input or saved step results without performing external actions.Required |
matched_labelTrue branch label | strStrInput | Matched | Names the true branch on the canvas. Connected edge labels update immediately while the stable port ID remains matched.Required |
otherwise_labelFalse branch label | strStrInput | Otherwise | Names the fallback branch on the canvas. Connected edge labels update immediately while the stable port ID remains otherwise.Required |
Ports
| Direction | Port ID | Kind | Value types |
|---|---|---|---|
| Input | inIn | control | FlowControl |
| Input | valueValue | data | JsonValue |
| Output | matchedMatched | control | FlowControl |
| Output | otherwiseOtherwise | control | FlowControl |
Node JSON example
The CLI creates the same structure from manifest defaults. Canvas position, title, and selection are presentation data.
CLI usage
Inspect the installed manifest first, then create the node and validate the complete workflow. Every command emits JSON.
Skill usage
The package includes the a3s-flow Skill. It queries the CLI catalog before creating, validating, compiling, and digesting a workflow.
Operational notes
- Read only data already committed to history.
- Do not read clocks, randomness, or remote state in an expression.
- Connect both control branches to explicit downstream behavior.
