Skip to main content

Parallel Order Preparation

Once the cart has been validated, several operations can run independently. In this lesson, reserve inventory and calculate delivery terms in parallel.

Full lesson walkthrough in the selected color theme.

When to Use a Parallel Block​

The flow already contains the cart-validation command and its response. The next operations do not depend on one another, so they should not be modeled as a strict sequence.

Loading image...
The completed initial pair becomes the entry point to the next stage

Add a step and select Parallel Execution. Enter a description that explains the shared purpose of the grouped actions.

Loading image...
The description connects the independent actions within one stage

After saving, an empty block appears in the list. Its internal + button adds steps to the nested sequence rather than to the main flow.

Loading image...
The nested add button keeps new steps inside the block

First Branch​

In the first branch, Order management subsystem calls Inventory management system. Create the Reserves inventory command and select its initiator and target. The Interacts through REST API relationship is selected automatically.

The structural relationship deliberately retains a durable name because it represents a lasting dependency. The specific action Reserves inventory belongs to this scenario and is therefore recorded in the flow. The arrow points from the order subsystem to inventory because the initiator knows the dependency; the response does not create a reverse structural relationship.

Loading image...
The first nested command reserves inventory over the general REST relationship

Add the response. The reverse direction appears on the diagram, and the block list shows a complete pair of actions.

Loading image...
The response confirms that inventory was reserved

Second Branch​

Using the same pattern, create Calculates delivery from Order management subsystem to Delivery management system, followed by Delivery parameters received. Keyboard shortcuts make repeated operations faster: 1 selects an interaction, 2 a command, 3 a response, and Ctrl + Enter or ⌘ + Enter saves the form.

Loading image...
The second nested command sends the inputs required to calculate delivery

The completed block contains two independent pairs. They belong to the same flow stage but impose no ordering between one another.

Loading image...
Two command-and-response pairs are grouped as parallel order preparation

Validate with Playback​

Start playback and move to the parallel stage. The player presents the actions inside the block one by one while preserving their shared parallel grouping.

Loading image...
The current command is highlighted on the diagram and in the nested step list

Continue playback to verify the second branch and the direction of its response.

Loading image...
The second pair returns the calculated delivery parameters

Chapters​

  • 00:00 — parallel processing;
  • 00:05 — adding a step;
  • 00:07 — selecting the block type;
  • 00:15 — empty parallel block;
  • 00:19 — first branch;
  • 00:53 — first response;
  • 01:09 — first branch completed;
  • 01:12 — speeding up repeated actions;
  • 01:16 — second branch;
  • 01:44 — second response;
  • 02:05 — completed block;
  • 02:11 — flow menu;
  • 02:22 — starting the scenario;
  • 02:27 — playing the first branch;
  • 02:32 — playing the second branch;
  • 02:36 — stopping playback;
  • 02:41 — lesson result.

Previous lesson: First Data-Flow Steps.

Next lesson: Internal Actions and Alternative Outcomes.