edges: [
{ from: "__trigger", to: "classify" },
{ from: "classify", to: "check" },
{ from: "check", to: "urgent", branch: "true" },
{ from: "check", to: "normal", branch: "false" },
{ from: "urgent", to: "join" },
{ from: "normal", to: "join" },
]edges = [
{"from": "__trigger", "to": "classify"},
{"from": "classify", "to": "check"},
{"from": "check", "to": "urgent", "branch": "true"},
{"from": "check", "to": "normal", "branch": "false"},
{"from": "urgent", "to": "join"},
{"from": "normal", "to": "join"},
]fromstringrequiredA step id, or __trigger for the start.
tostringrequiredA step id.
branchstringnextWhich output. true/false on a condition, a case key or default on a switch.
The rules
| Rule | Refusal |
|---|---|
Exactly one edge from __trigger | the workflow must have one |
| No step connects to itself | a step cannot link to itself |
| No cycle anywhere | the graph contains a loop |
| Every step reachable from the trigger | unreachable steps, named |
The trigger uses next only | the trigger uses only the next branch |
Three types have required shapes
| Type | Must have |
|---|---|
condition | exactly one true edge and one false edge |
switch | one edge per case, plus default |
merge | at least two incoming edges, and at most one next out |
A condition with only a true edge would end the run, without a word, whenever the answer was false. Requiring both means every path is a path somebody wrote.
Parallel fan-out
Several edges from one step on the same branch run in parallel. A merge step is how they come back together — and it needs at least two inputs, since merging one thing is not merging.
Without edges
The order of steps is the chain: trigger to the first, each to the next. The simple case stays simple, and no graph is written for a straight line.