Quick overview
This workflow shows how a support agent can send a confident refund reply even when the order data behind it is missing or incomplete, and how to catch that with saved executions and a validation step. It is Exercise 1 from the n8n Production AI Playbook on Audit & Trace.
How it works
- Receives a POST webhook request with an orderId and a customer message.
- Order Lookup returns a simulated order record and flags whether the lookup is complete.
- Validate Lookup, disabled by default, routes incomplete lookups to human review.
- Refund Support Agent drafts a reply from the lookup result using an OpenRouter chat model.
- Respond to Customer returns the reply, or Respond Needs Human returns a human-review status.
Setup
- Add an OpenRouter API credential to OpenRouter - Support. The template uses openai/gpt-4.1-mini, and any supported chat model works.
- In the workflow Settings, set Save manual executions to Save.
- Select Execute workflow and POST {"orderId":"ORD-1001","message":"Charged twice, refund the duplicate."} to the Webhook Test URL. Repeat with ORD-9999 and ORD-1004.
- Compare each reply with the Order Lookup output in the saved execution, then enable Validate Lookup and rerun all three requests.
Requirements
- n8n Cloud or a self-hosted n8n instance
- An OpenRouter API key
Customization
- Replace Order Lookup with your own database or order API, and keep the lookupComplete flag so Validate Lookup still works.
Additional info
All order records are synthetic and no payment is processed.