A subflow step calls a decision flow from within another decision flow.

In the step editor, the names are “Subflow execution definition” and “Subflow iteration definition”. The step needs a decision flow to execute, an input path, and an output path. If either path is empty, the step does nothing and the data passes through unchanged.

The default execution mode is Object. The portion of the data at the input path becomes the complete data of the called decision flow, which runs once. The complete resulting data is written to the output path.

The Array execution mode requires the input path to contain a list. The called decision flow runs once for each item, using that item as its data. The output path receives a list of results in the same order and under the same keys as the input list. If the input is not a list, the step writes nothing.

The input path $. means the whole data. The output path $. replaces the whole data with the result.

Subflows can be nested up to four levels deep. A subflow step at a deeper level is skipped without an error.

step-subflow.png

In our example, the engine will use information from the attribute $.application to evaluate the “SME lending: Credit policy” decision flow, and then set the outcome to $.credit_policy_result. The core data object will receive updates to the object in this manner.