A Broadway flow acts as a graph / tree and is built of several Stages where each Stage is a step of the flow.
The flow's Stages are executed consecutively from left to right. When there are several Stages on the same level, the execution order is top down. The Actors within each Stage are also executed top down.
A Stage can be added anywhere in the flow.
Each Stage can be split into two (and so on) to create several stages on the same dependency level.
To split a Stage, click in the right corner of the Stage to open the Stage context menu and select Split.
The Split's logic depends on the position of the Stage in the flow and includes the following rules:
Stages can be merged under the following conditions:
Valid Merge Example
Stages 1, 4 and 5 can be merged.
Invalid Merge Example
Stages 1 and 6 cannot be merged since they do not have a common parent.
If a condition is required in the flow, the flow can be split and a Stage condition Actor can be added to one or more Stages that have been created as a result of the split.
The condition Actor can have any number of output parameters; however a True / False check is always performed on the first output parameter. Note that this parameter does not need to be Boolean, since Broadway automatically casts its type to Boolean. For example, an empty string is considered to be false while a string that is not empty is considered to be true.
Click for more information about Broadway data types.
The else condition can be set on a Stage on the same level as the Stage Condition and is only executed if all conditions are false. Stages without a Stage condition are always executed and do not impact the else Stage.
The Stage's conditions impact all subsequent Stages in the same branch. Thus:
To add a Stage condition to the flow, click in the right corner of the Stage to open the Stage context menu and select Stage Condition to add an Actor to the Stage. The added Actor is grey.
To mark a Stage as else, click > Else.
Note that although any Actor can be used as a condition, a JavaScript Actor is a powerful actor for expressing complex conditions. The script returns the value of the last line and does not expect the return keyword.
Example 1
The following example shows a flow with four Stages on the second flow level:
Both conditions are checked, and each related branch is executed only if the condition is true. The else branch is executed when both conditions are false. The Stage without any conditions and its branch are always executed.
Depending on the flow input, the execution order of the Actors in this flow is:
Example 2
The following example displays a split flow with a condition and an else Stage where each branch is then also split into a condition and an else Stage.
Depending on the flow's input, the execution can run via one of four alternatives on the third level.
A Broadway flow acts as a graph / tree and is built of several Stages where each Stage is a step of the flow.
The flow's Stages are executed consecutively from left to right. When there are several Stages on the same level, the execution order is top down. The Actors within each Stage are also executed top down.
A Stage can be added anywhere in the flow.
Each Stage can be split into two (and so on) to create several stages on the same dependency level.
To split a Stage, click in the right corner of the Stage to open the Stage context menu and select Split.
The Split's logic depends on the position of the Stage in the flow and includes the following rules:
Stages can be merged under the following conditions:
Valid Merge Example
Stages 1, 4 and 5 can be merged.
Invalid Merge Example
Stages 1 and 6 cannot be merged since they do not have a common parent.
If a condition is required in the flow, the flow can be split and a Stage condition Actor can be added to one or more Stages that have been created as a result of the split.
The condition Actor can have any number of output parameters; however a True / False check is always performed on the first output parameter. Note that this parameter does not need to be Boolean, since Broadway automatically casts its type to Boolean. For example, an empty string is considered to be false while a string that is not empty is considered to be true.
Click for more information about Broadway data types.
The else condition can be set on a Stage on the same level as the Stage Condition and is only executed if all conditions are false. Stages without a Stage condition are always executed and do not impact the else Stage.
The Stage's conditions impact all subsequent Stages in the same branch. Thus:
To add a Stage condition to the flow, click in the right corner of the Stage to open the Stage context menu and select Stage Condition to add an Actor to the Stage. The added Actor is grey.
To mark a Stage as else, click > Else.
Note that although any Actor can be used as a condition, a JavaScript Actor is a powerful actor for expressing complex conditions. The script returns the value of the last line and does not expect the return keyword.
Example 1
The following example shows a flow with four Stages on the second flow level:
Both conditions are checked, and each related branch is executed only if the condition is true. The else branch is executed when both conditions are false. The Stage without any conditions and its branch are always executed.
Depending on the flow input, the execution order of the Actors in this flow is:
Example 2
The following example displays a split flow with a condition and an else Stage where each branch is then also split into a condition and an else Stage.
Depending on the flow's input, the execution can run via one of four alternatives on the third level.