Quick overview
This workflow triggers on incoming NUACOM WhatsApp messages, only responds after hours, and uses an OpenAI-powered agent with an n8n Data Table knowledge base plus Google Calendar tools to answer questions, manage appointments, or hand off chats to a NUACOM human team.
How it works
- Triggers when NUACOM receives a WhatsApp message.
- Filters messages to only process those sent to a specific WhatsApp number and normalizes key fields like sender number, message text, and message ID.
- Checks the current time in Europe/Dublin against configured opening and closing times to decide whether it is outside business hours.
- If outside business hours, assigns the conversation to a designated NUACOM AI user and sends the message (with recent conversation context) to an OpenAI chat model.
- The AI agent answers business questions by querying an n8n Data Table knowledge base first, and it can check, book, reschedule, or cancel appointments by calling Google Calendar.
- If the customer explicitly agrees to a handoff, the agent assigns the conversation to a NUACOM group for a human agent to follow up.
- Sends the agent’s reply back to the customer over WhatsApp via NUACOM.
Setup
- Add NUACOM API credentials, ensure WhatsApp is enabled on your NUACOM number, and set the NUACOM assignees (AI user ID and human group) used for conversation assignment.
- Update the allowed receiver number filter (or remove it) and confirm the business hours and timezone values match your organization.
- Create and populate the n8n Data Table used as the WhatsApp chatbot knowledge base, and point the workflow to the correct table.
- Add OpenAI credentials (or n8n AI Gateway access) and select the chat model you want the agent to use.
- Connect Google Calendar OAuth2 credentials and select the target calendar where appointments are checked, booked, rescheduled, and cancelled.