Draft and return the not-eligible message
For an order that isn't closed, the flow explains in customer-ready language why the return can't proceed, and returns that message to the agent.
In the If not a closed Order branch, add an M365 Copilot action and connect it from the branch. Create its connection if prompted, then rename the action:
Draft Not Eligible MessageIn the M365 Copilot Message, enter the instruction:
Create a short customer-facing message that the return for order [Order Number] is not eligible because the order is not yet closed. An order is closed only once the customer has received it. Write a single ready-to-send message with no placeholders.After typing the prompt, replace
[Order Number]with the Order Number dynamic value from the trigger. In the dynamic-content picker, take it from the When an agent calls the workflow group, not from List Order Rows. Both groups offer an order number: the trigger's is a single value; the List rows one is a per-row column, and picking it makes the designer wrap your action in a loop.
Note
⚠️ Important: If an Apply to each container suddenly appears around an action after you insert a dynamic value, you picked the per-row value. The inserted chip reads item().…, and the flow checker will report broken references. To recover: remove the action from the loop, delete the Apply to each, restore the connections (branch → action → Respond to the agent), and re-insert the value from the trigger group instead.
Under Advanced parameters, set Time Zone to your own (for example America/New_York) and leave the Prefer Async toggle Off, so the action returns an immediate, synchronous result.
By default, Respond to the agent is still connected straight from the If/Else. Delete that default connection.
Add a Variable action with Update Variable, renamed
Update Not Eligible Response, that setsresponseto the Response dynamic value of Draft Not Eligible Message.Wire the branch Draft Not Eligible Message → Update Not Eligible Response → Respond to the agent.
Finally, in the Respond to the agent action, add a Text output named
responseand set its value to the response variable. Take it from the Variables group in the picker, not from the M365 action.
Note
This binding is set once and never changes: every path you build from here will end by writing its message into that one variable, which is what lets a single respond action serve the whole flow.
Select Save, then Publish. Publishing is required before you can run the flow, even for a local test.
Test this path with the Run node (or the play button on a step): provide an Order Number for an order that isn't closed and run it to validate the schema and see the returned JSON.
Note
💡 Tip: Need an order that isn't closed? In the Power Apps tab from Step 2, open Tables > Orders, find the Order Status column, and filter it to Does not equal > Closed. Any Order Number in the filtered list will do.
✅ Checkpoint: For an order that isn't closed, the flow generates a customer-facing "not eligible" message and returns it to the agent.


