Module 08 · ai · intermediate
Exercises 08 · AI Support Agent
Start from workflow/starter.json (Chat Trigger + lookup_order) or your finished lesson workflow.
Exercise 1: Orders from a real data source
Task: Replace the demo orders object with a Google Sheet (order_id, email, status, items, carrier, tracking, estimated_delivery).
Done when: adding a row to the sheet makes the agent find that new order.
Hint
Use the Google Sheets Tool (the tool version of the node) with a filter on order_id, and let the model fill the value with $fromAI('order_id'). Or call a sub-workflow with the Call n8n Workflow Tool.
Exercise 2: Real tickets
Task: Make create_support_ticket actually save the ticket (Google Sheet row) and notify you (email/Slack/Telegram).
Done when: asking for a human creates a row and sends you a message with the summary.
Hint
Build a sub-workflow (inputs: summary, customer_contact, priority) that appends + notifies + returns the ticket ID, then connect it with Call n8n Workflow Tool. Remember: publish the sub-workflow (Module 04).
Exercise 3: Embed it on a website
Task: Put the chat on a web page.
Done when: a local index.html shows the chat bubble and conversations work.
Hint
Switch the Chat Trigger mode to Embedded Chat, add your page's origin to Allowed Origins (CORS), and use the @n8n/chat package's createChat({ webhookUrl }) snippet.
Stretch: Evaluate it
Write 10 realistic customer messages with expected facts, run them through the chat API in a loop (like test/test.sh), and track how many pass when you change the prompt or model.