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.

  1. From Setup, in the Quick Find box, enter Flows, and then select Flows.

  2. Click to select a checkout subflow that runs asynchronously .

  3. 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. )

  4. Enter a label and API name (such as Check Inventory) for the New Action element.

  5. Under cartId, add {!cartId}. This variable represents the ID value of the current cart.

  6. Click Done.

  7. Delete the subflow action you want to replace.

  8. Drag and connect the new action.

  9. Click Save as and click New Flow.

  10. Enter Asynch Check Inventory in the Flow Label and Flow API Name fields.

  11. To make the new action available, reload the checkout flow.

  12. Drag a new subflow onto the canvas.

  13. Enter Inventory in the Referenced flow pane and choose the new asynchronous subflow.

  14. Enter Asynch Check Inventory in the label and API Name fields for this subflow.

  15. In the Set Input Values, choose {!cartId} and also checkoutsessionId.

  16. Click Done.

  17. Delete the old Apex Action Check Inventory (the synchronous node).

  18. Connect the new Async Check Inventory subflow.

  19. Click Save.

  20. Reload the page.

You can now choose this modified checkout flow in Experience Builder.