Running subflows in parallel or sequentially with arrays

You can run a subflow multiple times as an array. The subflow will run as many times as the size of the array. In the array attributes, you can define whether to run the subflow in parallel or sequentially.

About this task

Any existing subflows saved in IBM Spectrum LSF Application Center that you want to run as arrays must have the status Published.

When a subflow is run as an array, each element takes a unique name in the form of flow_array_name(array_index).

For example, if the name of the flow array instance is 1:usr1:FA, and its index is 1 to 3, the three elements have the name of 1:usr1:FA(1), 1:usr1:FA(2), and 1:usr1:FA(3).

Tip: View the example: Resources > Flow Definitions > New > Flow Definition and select Import an example definition, flowarray_eval.xml in the Create Draft Definition dialog.

Procedure

  1. Within a flow in Flow Editor, select Insert > Subflow or Flow Array.

    The subflow array icon is added to your flow.

  2. Select the icon, right-click, and select Open Definition.

    The subflow definition is displayed.

  3. Select the subflow to run as an array.
  4. Select Run this subflow as an array to create the array and specify the number of elements in your array in the First Element and Last Element fields.

    In the First Element and Last Element fields, you can use user variables to specify the flow array index, allowing flow arrays with dynamic element fields. At runtime, before the dynamic flow array is started, Process Manager replaces the variables with values, which are usually set by a predecessor job.

    Within a flow array element, the #{JS_FLOW_INDEX} variable specifies the array index of the flow array element.

  5. In Run flow array elements, select whether to run your flow array sequentially or in parallel.

    You can view and edit the jobs in the subflow in the array by double-clicking on the subflow icon.