Hi Community,
We are implementing an Order Management workflow using a Supervisor Agent.
Our workflow is:
- Create Sales Order
- Submit Sales Order
- Sales Order is auto-approved
- Create Work Order
- Create Inventory Reservation against the Sales Order / Work Order
The issue we are facing is that after the Sales Order submission API returns success, Fusion takes a few seconds to complete backend processing and move the Sales Order from Draft to a valid submitted status.
The Supervisor Agent immediately continues to the next steps. During this period, when the Inventory Reservation API is invoked, we intermittently receive errors such as:
DemandSourceHeaderNumber is invalid
From our analysis, this happens because the reservation request is executed before the Sales Order processing is fully completed and the demand source becomes available.
Questions
- Is there a built-in wait/delay mechanism available in a Supervisor Agent before executing the next step?
- Can a Supervisor Agent pause execution until a previous transaction reaches a specific status?
- Is there a recommended polling/retry pattern to check whether a Sales Order has completed processing before invoking dependent APIs?
- What is the recommended approach for handling backend processing delays between Sales Order submission and Inventory Reservation creation in a Supervisor Agent workflow?
Any guidance or best practices would be greatly appreciated.
Thank you.