Managing customer support across multiple platforms like email and chat can be a huge time sink. Answering the same questions about order status repeatedly takes your focus away from growing your business. This workflow solves that problem by deploying a 24/7 conversational AI agent to act as your first line of support for your WooCommerce store.
This AI-powered bot can handle customer inquiries from both Telegram and Gmail, understand conversational follow-ups, and use a tool to fetch live order data directly from your WooCommerce store. It's designed to be reliable, with a primary/fallback AI model setup, and robust enough to prevent the common pitfalls of email automation like infinite reply loops.
The workflow operates in a clear, logical sequence:
📢 Multi-Channel Ingestion: The workflow starts when it receives a message from one of two sources:
💎 Data Normalization: All incoming requests are merged and processed by a Set
node. This crucial step transforms the platform-specific data into a universal format that the rest of the workflow can understand (e.g., platform
, sender_id
, query_text
).
🧠 AI Processing: The standardized query is sent to a LangChain Agent. This agent is the "brain" of the operation. It uses Conversational Memory to understand the context of the conversation (like when a user provides an order ID in a follow-up message).
🛠️ Tool Usage: Based on its prompt, the AI Agent determines if it has enough information to use its one available tool: Get an order in WooCommerce. If a valid Order ID is present, it calls the tool to fetch live order details.
📮 Response & Routing: The agent formulates a natural language response. A Switch
node then inspects the platform
field and routes the response to the correct channel.
✅ Cleanup: For the Gmail path, two final actions occur in parallel: the reply is sent, and the original incoming email is marked as 'Read'. This is a critical step to prevent the workflow from re-triggering on the same email in an infinite loop.
This workflow uses a combination of standard nodes and AI nodes to achieve its goal:
To use this workflow, you will need:
Follow these steps to set up the workflow:
Download the Workflow: Import the workflow JSON file into your n8n instance.
Configure Credentials:
Telegram: Select your Telegram API credentials in the Fetch user query
and Send Telegram Response
nodes.
Gmail: Select your Gmail OAuth2 credentials in the Fetch support mail
, Send Response via Mail
, and Mark received mail as read
nodes.
WooCommerce: Select your WooCommerce API credentials in the Get an order in WooCommerce
node.
AI Models: Select your OpenAI and Google AI credentials in the Fallback Model
and Primary Model
nodes, respectively.
Activate Telegram Webhook:
Fetch user query
(Telegram Trigger) node./setWebhook
command in the BotFather chat.Customize AI Prompt (Optional):
WooCommerce Customer support Agent1
node.Activate the Workflow: Save the workflow and toggle the "Active" switch ON.
Your multi-channel AI support agent is now live! Send a message to your Telegram bot or a new, unread email to your connected Gmail account to test it out.