Quick overview
This workflow powers a website chat that uses OpenAI to answer product questions, look up order status, and guide visitors through opening return requests, saving confirmed returns to an n8n Data Table and notifying your support team by email.
How it works
- Receives a new visitor message (and optional image upload) through an n8n hosted chat webhook.
- Uses an OpenAI chat model with conversation memory to respond, calling built-in tools to search products and to look up an order by order number and email.
- Formats the assistant reply and, when enabled, includes rich product and order “card” payloads in the chat response.
- If the assistant requests a return, re-checks the order details and verifies return eligibility and that no return is already open for the order in an n8n Data Table.
- Prompts the visitor to confirm or decline opening the return using an approval button in the chat.
- When approved, saves the return request to an n8n Data Table and emails your support address with the return details and any attached photo, then sends the visitor a confirmation message.
Setup
- Add OpenAI credentials (or another tool-calling chat model supported by n8n) and select the model in the chat model node.
- Configure an SMTP email account for the email-sending step (or replace it with Gmail/Outlook/Slack) and set the support and sender addresses in the Settings values.
- Replace the sample product search and sample order lookup logic with your store system (for example WooCommerce/Shopify/API) while keeping the expected fields (order number, billing email, line items, status, dates, totals).
- Set your return window (days) in the return policy value and adjust the visitor-facing button labels/messages if you need different language.
- Publish the workflow, copy the production chat webhook URL, restrict Allowed Origins to your website domain, and embed the chat widget on your site using that webhook URL.