Quick overview
This workflow receives inbound WhatsApp messages via Whapi, screens them with OpenAI-powered guardrails, and replies using an OpenAI support agent that can search a Notion knowledge base, look up live WooCommerce orders/products/customers, and escalate complex cases to a human via Gmail.
How it works
- Receives an incoming WhatsApp message via a webhook endpoint configured in Whapi.
- Extracts key settings and message fields (sender phone, type, text, thresholds, and escalation email) and stops non-text requests by replying with a “text only” message.
- Uses OpenAI guardrails to detect jailbreak attempts, NSFW content, and off-topic requests, and sends a policy-violation reply when the message is unsafe.
- Passes safe customer messages to an OpenAI agent with conversation memory keyed to the customer phone number.
- The agent answers by searching policies and FAQs in Notion and fetching real-time order, product, and customer data from WooCommerce when needed.
- If the agent decides the issue needs a human, it emails the escalation details to the support manager through Gmail.
- Sends the agent’s final response back to the customer on WhatsApp via the Whapi API.
Setup
- Create a Whapi account, connect your WhatsApp number, and configure Whapi to POST incoming messages to this workflow’s webhook URL.
- Add OpenAI API credentials and choose the model to use in the workflow’s configuration values.
- Add WooCommerce REST API credentials (consumer key/secret) and ensure your store API access is enabled.
- Add a Notion API connection and ensure your support knowledge base exists as searchable Notion pages.
- Add a Gmail OAuth2 connection and set the support manager email address in the Configuration values for escalations.
Additional info
Handle e-commerce customer support on WhatsApp with AI, WooCommerce and Notion
Need help customizing?
Contact me for consulting and support : Linkedin
MY NEW YOUTUBE CHANNEL
👉 Subscribe to my new YouTube channel. Here I'll share videos and Shorts with practical tutorials and FREE templates for n8n.
