Change a B2B Subflow: Asynchronous or Synchronous
You can change a subflow to run synchronously or asynchronously in Flow Builder.
Required Editions |
---|
Available in: Enterprise, Unlimited, and Developer Editions |
Required Editions |
---|
Available in: B2B Commerce |
The example used in this task shows how to modify a synchronous Check Inventory subflow to run asynchronously.
This topic assumes that you deployed the Main, Pricing and Promotions, or Re-Entrant checkout flows.
-
From Setup, in the Quick Find box, enter
Flows
, and then select Flows. -
Click to select a checkout subflow that runs asynchronously .
-
Drag a New Action element to the canvas, enter
Inventory
in the Action pane, and choose the asynchronous checkCartInventoryAction- checkCartInventoryAction. (The synchronous counterpart is apex_B2BSyncCheckInventory. ) -
Enter a label and API name (such as Check Inventory) for the New Action element.
-
Under cartId, add
{!cartId}
. This variable represents the ID value of the current cart. -
Click Done.
-
Delete the subflow action you want to replace.
-
Drag and connect the new action.
-
Click Save as and click New Flow.
-
Enter
Asynch Check Inventory
in the Flow Label and Flow API Name fields. -
To make the new action available, reload the checkout flow.
-
Drag a new subflow onto the canvas.
-
Enter
Inventory
in the Referenced flow pane and choose the new asynchronous subflow. -
Enter
Asynch Check Inventory
in the label and API Name fields for this subflow. -
In the Set Input Values, choose
{!cartId}
and alsocheckoutsessionId
. -
Click Done.
-
Delete the old Apex Action Check Inventory (the synchronous node).
-
Connect the new Async Check Inventory subflow.
-
Click Save.
-
Reload the page.
You can now choose this modified checkout flow in Experience Builder.