Control flow concepts
A control flow performs a series of tasks in sequence. It begins executing at a Start step and continues through connected steps until it finishes at a step that has no more outbound hops.
Control flows start executing at their start step. If a control flow has no start step or if there are multiple, it will not run.
When a step executes, it performs its task, and selects one of its output gates to move on to the next step. Most steps do not make branching decisions and only have a single out gate. Steps that do support branching decisions have a corresponding set of gates and select exactly one gate through which to continue.
The control record
The control record is a dict value that is carried along the execution path. It is initialized as an empty dict at the start step, and subsequent steps have the opportunity to add, remove and replace fields. This mechanism allows steps to record information subsequent steps can access.
In step configuration, the entire control record is available as the
row variable, and individual fields are available as
Steps can encounter errors during execution. Files can be missing, databases may be unavailable, data may be in bad format, etc. Some errors are recoverable in the sense that even though they occur, the flow can maintain integrity and continue processing. Some errors are not recoverable in the sense that further processing is not possible, or likely to generate heavily corrupted outcomes.
Steps define error gates to deal with errors. If a step encounters a recoverable error, it tries to continue through the error gate. If another step is connected through the error gate, execution continues there and the field
error is set on the control record. The
error field contains details about what went wrong. If there is no step connected at the error gate, the flow aborts as a whole. If a step encounters an error that is not recoverable, no attempt is made to continue through the error gate and the flow aborts immediately.
A control flow finishes successfully after executing a step that has no more outbound hops. You can use the Finish step to make the intended end of execution explicit.
Control flows that finish successfully may provide a return value called the result. By default the result value is
nil. The Finish step can set the result value explicitly. When running a flow through the Run Flow step, the result value is available as one of the run results.
A failed control flow always has a result value of