Shopify Ai voice store manager n8n 

Shopify Ai voice store manager n8n 

New to n8n? Start with our step-by-step setup guide, then come back to build this workflow.

Managing a Shopify store means checking the dashboard, hunting for order IDs, editing products one by one, and emailing customers manually. Every one of those tasks takes you away from actually growing the business. This n8n Shopify AI agent changes that completely. First, you send a voice note or text message on WhatsApp. Next, the AI understands your command, queries your live store, and takes action: updating orders, managing products, sending customer emails, and logging everything to Google Sheets. As a result, your entire store becomes controllable from your phone, hands-free, in English, Arabic, or French.

Prefer to skip the build? Grab the ready-made template → and be managing your Shopify store by voice in under 20 minutes.

What You’ll Build

  1. You send a WhatsApp text or voice note to your business number. “How many orders came in today?” or “Update the price of the blue hoodie to $49.”
  2. If it’s a voice note, ElevenLabs transcribes the audio to text automatically before passing it to the AI.
  3. The AI agent reads your command, calls the right Shopify tool (get orders, update a product, create a listing, delete a variant) and executes it against your live store.
  4. Order data is written to a Google Sheet for tracking, and customer emails are sent via Gmail when you ask.
  5. The AI replies back to WhatsApp: text if you typed, a voice note in the same Charlie voice if you spoke.
  6. Every conversation is remembered per WhatsApp contact, so context carries forward across messages.

How This n8n Shopify AI Agent Works: The Big Picture

The workflow has two entry paths that merge at the AI agent, and two exit paths that split again based on whether the original message was text or audio. In between, the AI has six Shopify tools it can call autonomously, plus Google Sheets and Gmail. Here is the full picture:

┌──────────────────────────────────────────────────────────────────────────────┐
│  N8N SHOPIFY AI AGENT — WHATSAPP VOICE STORE MANAGER                        │
│                                                                              │
│  [WhatsApp Trigger]                                                          │
│          │                                                                   │
│          ▼                                                                   │
│  [Switch: text or audio?]                                                    │
│     │ text                   │ audio                                         │
│     ▼                        ▼                                               │
│  (straight to          [Get Media URL]                                       │
│   AI Agent)            [Download Audio Binary]                               │
│                        [ElevenLabs: Speech-to-Text]                         │
│                              │                                               │
│                    ──────────┘                                               │
│                    ▼                                                         │
│           [AI Agent — Store Manager]                                         │
│            │  Tools available:                                               │
│            ├─ [Shopify: Get Orders]                                          │
│            ├─ [Shopify: Get Products]                                        │
│            ├─ [Shopify: Update Order]                                        │
│            ├─ [Shopify: Create Product]                                      │
│            ├─ [Shopify: Update Product]                                      │
│            ├─ [Shopify: Delete Product]                                      │
│            ├─ [Google Sheets: database (append/update)]                      │
│            └─ [Gmail: Send Email]                                            │
│            │  Memory: Simple Memory (per WhatsApp contact)                  │
│            │  Model:  OpenRouter Chat Model                                  │
│                    │                                                         │
│                    ▼                                                         │
│           [Switch1: was original text or audio?]                             │
│             │ text                    │ audio                                │
│             ▼                         ▼                                      │
│    [WhatsApp: Send text]    [ElevenLabs: Text-to-Speech]                    │
│                             [Code: Set MIME → audio/mpeg]                   │
│                             [WhatsApp: Send voice note]                     │
└──────────────────────────────────────────────────────────────────────────────┘

What You’ll Need

  • n8n: self-hosted or n8n Cloud (v1.30+). See the n8n hosting documentation for setup options.
  • WhatsApp Business API: a verified Meta business phone number with a permanent access token. See the WhatsApp Cloud API getting-started guide.
  • Shopify store: with a private app or OAuth app that has read/write access to Orders and Products.
  • ElevenLabs account: free tier works for testing; choose any voice from your library.
  • OpenRouter account: to power the AI agent; Claude, GPT-4o, or Llama 3 all work.
  • Google Sheets: one spreadsheet with an “orders” tab containing the 14-column schema shown below.
  • Gmail account: connected via OAuth2 in n8n for sending customer emails.

Estimated build time: 60 to 90 minutes from scratch, or under 20 minutes with the ready-made template.

Part 1: Receiving the WhatsApp Message

1 WhatsApp Trigger

This node opens a webhook endpoint that Meta’s WhatsApp Cloud API calls every time a message arrives on your business number. It listens for the messages event type, which covers both text messages and media (audio, images, documents). Every incoming message delivers a payload with two fields the rest of the workflow relies on: messages[0].type (either text or audio) and contacts[0].wa_id (the sender’s phone number, used as the session key for memory).

// Incoming WhatsApp payload — text message example
{
  "messages": [
    {
      "type": "text",
      "text": { "body": "How many orders are pending today?" }
    }
  ],
  "contacts": [
    { "wa_id": "15551234567", "profile": { "name": "Sarah Thompson" } }
  ]
}
📌

Note: Your WhatsApp webhook must be registered in the Meta Developer Console pointing to your n8n webhook URL. The verification token is set in the WhatsApp Trigger node credentials. Make sure your n8n instance is publicly reachable, it cannot run on localhost.

2 Switch: Text or Audio?

First, the Switch node reads $json.messages[0].type. If it equals text, the message goes directly to the AI Agent. If it equals audio, the message takes a detour through three nodes to transcribe the voice note before the AI sees it. This routing is what makes the workflow truly voice-native: the AI always receives clean text, regardless of how the user communicated.

// Switch routing logic
{
  "route_text":  "messages[0].type === 'text'",
  "route_audio": "messages[0].type === 'audio'"
}

Part 2: Transcribing Voice Messages

3 Download Media (WhatsApp)

When the message is audio, this node calls the WhatsApp media endpoint to get the audio file’s download URL. It passes $json.messages[0].audio.id, the media ID from the trigger payload, and receives back a temporary URL that expires after a few minutes.

4 Download Audio (HTTP Request)

Next, this HTTP Request node fetches the actual audio binary from the URL returned by the previous step. It uses the WhatsApp API credentials for authentication, since Meta’s media URLs require a valid access token in the request headers. The output is a binary file that ElevenLabs can process.

5 Transcribe Audio (ElevenLabs)

ElevenLabs Speech-to-Text converts the audio binary into plain text with high accuracy, including for Arabic and French, matching the multilingual capability of the AI agent. The transcribed text arrives as $json.text, which the AI Agent reads via its Audio input: {{ $json.text }} prompt field.

💡

Tip: ElevenLabs handles background noise, accents, and mixed-language voice notes well. For store managers recording quick commands while walking around a warehouse, this reliability is critical. If you want to reduce API costs, you can swap ElevenLabs for OpenAI’s Whisper node, which is cheaper for high-volume transcription.

Part 3: The AI Store Manager Agent

6 AI Agent, Store Manager

This is the brain of the entire workflow. The AI Agent node receives either the text body or the transcribed audio, then decides which tools to call and in what order to fulfill the command. Its system prompt defines its role as a Shopify store manager, its available tools, its language capabilities, and one important rule: always call Get orders before updating an order, to retrieve the order ID first.

The agent prompt sets the behavior clearly. For example, the current system prompt instructs:

role: You are a smart AI voice Store Manager for my Shopify Store.
tasks:
- Always use 'Get orders' to get order/sales details
- Before you update orders, always get the order ID first from 'Get orders'
tools: shopify tool, Google Sheets 'database', Gmail
languages: English, Arabic (Modern Standard Arabic), French
💡

Tip: The system prompt mentions “Pet_shop” as the Gmail sender name, update this to your actual store name in both the AI Agent system prompt and the Gmail Tool node’s senderName field before going live.

7 OpenRouter Chat Model

The AI Agent is powered by OpenRouter, which gives you access to 100+ language models through a single API key. The default model is not hardcoded, you choose it in the OpenRouter Chat Model node’s dropdown. For store management commands (structured data retrieval, product updates), Claude 3.5 Sonnet or GPT-4o Mini deliver excellent results at low cost. Switch models any time without touching the rest of the workflow.

8 Simple Memory

The memory node gives the agent a 20-message conversation window, keyed to each contact’s WhatsApp phone number (wa_id). This means when a user follows up with “Actually, add a note to that order saying urgent delivery,” the agent remembers which order they were discussing without being told again. Each WhatsApp contact gets a fully isolated conversation context. 50 customers messaging simultaneously creates 50 separate memory streams.

Part 4: Shopify Tools the Agent Can Use

The AI agent has six Shopify tools available. It calls them autonomously, you never have to specify which tool to use in your WhatsApp message. Just describe what you want in plain language, and the agent decides.

ToolWhat it doesExample command that triggers it
Get Orders Fetches all orders from Shopify. The agent controls returnAll and limit via $fromAI() based on your request. “Show me today’s orders” / “How many pending orders do we have?”
Get Products Fetches all products from the catalog. Returns titles, prices, variants, and inventory levels. “List all products under $30” / “Do we still have the red sneakers in stock?”
Update an Order Updates an order by ID. First calls Get Orders to find the correct ID, then applies changes like notes or tags. “Add a note to order #1023 saying the customer requested gift wrapping.”
Create a Product Creates a new product with a title and optional additional fields (description, price, images). “Create a new product called Summer Linen Tote Bag at $24.99.”
Update a Product Updates a product’s title and HTML body description by product ID. First calls Get Products to find the ID. “Update the Blue Hoodie description to add washing instructions.”
Delete a Product Permanently deletes a product from Shopify by product ID. “Remove the discontinued Winter Scarf from the catalog.”
📌

Important: The Delete a product tool is permanent. There is no confirmation step. If the AI identifies the product and you asked it to delete, it will. Add a safety confirmation step (an IF node or a WhatsApp confirmation reply) if you want to prevent accidental deletions in production.

Part 5: Database and Email Tools

9 Google Sheets: Database Tool

Every time the agent retrieves or acts on an order, it can write the data to your Google Sheet using the appendOrUpdate operation. The Order ID column is the matching key, so re-running a command on the same order updates the existing row rather than duplicating it. All 14 fields are populated via $fromAI() expressions, meaning the agent extracts each value from the Shopify response and maps it automatically.

10 Gmail: Send Email Tool

When you ask the agent to email a customer, it calls this tool, filling the To, Subject, and Message fields via $fromAI(). The sender name is set to your store name. For example, you can say: “Email james.carter@gmail.com and tell him his order shipped today” and the agent writes and sends the email entirely on its own.

Part 6: Sending the Reply

11 Switch1: Reply in Text or Voice?

After the AI agent finishes, a second Switch node checks the original message type again. If you sent text, you get a text reply. If you sent a voice note, the agent converts its response to speech and sends a voice note back. The reply always matches the input format: a voice conversation stays a voice conversation.

12 Convert Text to Speech (ElevenLabs)

For audio replies, this node sends the AI agent’s text output to ElevenLabs using the “Charlie: Deep, Confident, Energetic” voice. The settings are configured for natural, professional delivery: stability at 1.0, similarity boost at 1.0, and speed at 0.82 (slightly slower than default, which works better for information-dense store management replies). The output format is MP3 at 22050 Hz.

13 Convert to MPEG (Code Node)

WhatsApp’s API is strict about audio MIME types. This Code node sets mimeType to audio/mpeg and renames the file to voice.mp3, without this step, WhatsApp rejects the audio upload and the voice reply fails silently.

for (const item of $input.all()) {
  if (item.binary && item.binary.data) {
    item.binary.data.mimeType = 'audio/mpeg'
    item.binary.data.fileName = 'voice.mp3'
  }
}
return $input.all();

14 Send Message / Send Message1 (WhatsApp)

Two WhatsApp send nodes handle the two reply paths. Send message1 (text path) sends the AI output as a plain text body. Send message (audio path) sends the MPEG binary as an audio message. Both always reply to the original sender using $('WhatsApp Trigger').item.json.contacts[0].wa_id.

The Data Structure: Google Sheets Order Database

Create a Google Sheet with one tab named orders. The column names below are case-sensitive, and the agent uses them as keys when writing rows via $fromAI().

Column NameTypeExample ValueDescription
Order IDText5678901234Shopify order ID, used as the matching key to prevent duplicate rows
Order NameText#1023Human-readable order name shown in the Shopify dashboard
Order DateTextMarch 18, 2026Date the order was placed
Customer NameTextJames CarterFull name from the Shopify order
Customer EmailTextjames.carter@gmail.comUsed when sending confirmation emails via Gmail
Customer PhoneText(555) 867-5309Contact number from the order
Product TitleTextBlue Hoodie, Size MProduct name and variant from the order line item
QuantityText2Number of units ordered
Product PriceText$49.00Unit price at time of order
Total Order AmountText$98.00Full order total including all line items
CurrencyTextUSDCurrency code from the Shopify order
Payment StatusTextpaidShopify financial status: paid, pending, refunded
SourceTextonline_storeOrder source channel from Shopify
Agent NoteTextCustomer requested express shippingAI-generated note about the order based on conversation context
📌

Setup step: Create the sheet with these exact headers before activating the workflow. The Order ID column is the matching key. A second write with the same ID updates the existing row instead of creating a duplicate. Name the tab exactly orders (lowercase) to match the workflow configuration.

Full System Flow: n8n Shopify AI Agent End to End

You send a WhatsApp message: "Update the Blue Hoodie price to $44"
          │
          ▼
[WhatsApp Trigger] → { messages[0].type: "text", text.body: "Update the Blue Hoodie price to $44" }
          │
          ▼
[Switch: type = "text"] → routes to AI Agent directly
          │
          ▼
[AI Agent — Store Manager]
  → calls [Get Products] → finds Blue Hoodie, product_id: 7890123456
  → calls [Update a Product] → sets title + new price on Shopify
  → calls [Google Sheets database] → logs order/product change
  → generates reply: "Done! Blue Hoodie updated to $44.00 in your store."
          │
          ▼
[Switch1: original type = "text"]
          │
          ▼
[WhatsApp: Send text reply] → "Done! Blue Hoodie updated to $44.00 in your store."

────────────────────────────────────────────────────────────

You send a WhatsApp voice note: "Send an email to James about his order"
          │
          ▼
[WhatsApp Trigger] → { messages[0].type: "audio", audio.id: "media_id_xyz" }
          │
          ▼
[Switch: type = "audio"] → routes to audio transcription path
          │
[Download Media URL] → { url: "https://lookaside.fbsbx.com/..." }
[Download Audio Binary] → binary MP3 file
[ElevenLabs: Speech-to-Text] → { text: "Send an email to James about his order" }
          │
          ▼
[AI Agent — Store Manager]
  → calls [Get Orders] → finds James Carter, order #1023, james.carter@gmail.com
  → calls [Gmail: Send Email] → sends order update email to james.carter@gmail.com
  → generates reply: "Email sent to James Carter at james.carter@gmail.com for order #1023."
          │
          ▼
[Switch1: original type = "audio"]
          │
[ElevenLabs: Text-to-Speech] → MP3 audio of reply in Charlie voice
[Code: Set mimeType = audio/mpeg]
[WhatsApp: Send voice note] → 🔊 Voice reply delivered to sender

Testing Your n8n Shopify AI Agent

  1. In n8n, activate the workflow and copy the WhatsApp webhook URL. Register it in the Meta Developer Console under your app’s webhook settings.
  2. Send a text message to your WhatsApp business number: “List all products.” Confirm the AI responds with your actual Shopify catalog.
  3. Send a voice note saying: “How many orders do we have this week?” Confirm the audio is transcribed, the AI calls Get Orders, and you receive a voice reply with the count.
  4. Send: “Create a test product called Test Widget at $9.99.” Check your Shopify Products dashboard to confirm it appeared.
  5. Send: “Delete the Test Widget product.” Confirm it’s removed from Shopify. Then send the same command again, the AI should respond that the product no longer exists, demonstrating it uses Get Products before acting.
  6. Send: “Email emily.rodriguez@outlook.com and tell her order #1001 has shipped.” Check your Gmail Sent folder to confirm the email was sent with the correct content.
  7. Open your Google Sheet and confirm order rows are being written or updated correctly.
ProblemLikely CauseFix
Webhook not receiving messages n8n URL not registered in Meta Developer Console, or instance not publicly accessible Verify the webhook URL and token in Meta Developer Console → WhatsApp → Configuration. Use ngrok for local testing.
Voice reply fails, audio not delivered Missing MIME type fix or wrong phone number ID Confirm the “Convert to mpeg” Code node runs before the send node. Replace YOUR_WHATSAPP_PHONE_NUMBER_ID with your actual Phone Number ID from the Meta console.
AI says “I can’t find that product” but it exists Agent is not calling Get Products before Update Product Add an explicit instruction to the system prompt: “Always call Get Products before updating or deleting any product.”
Google Sheet not updating Column names don’t match exactly (case-sensitive) Compare sheet headers character-by-character against the schema table above. Make sure the tab is named orders.
Gmail not sending OAuth2 token expired or incorrect sender name Reconnect the Gmail OAuth2 credential in n8n. Update senderName in the Gmail Tool node from “Pet_shop” to your store name.
AI responds in the wrong language Language detection relies on user input. Mixed messages can confuse it Update the system prompt to specify a default language: “If the language is unclear, respond in English.”

Frequently Asked Questions

Does this n8n Shopify AI agent work with Shopify Basic, Grow, or Advanced plans?

Yes. The workflow uses the Shopify REST API via n8n’s native Shopify nodes, which are available on all paid Shopify plans. You need to create a custom app in your Shopify admin under Settings → Apps → Develop apps and grant it read/write access to Orders and Products. The API credentials generated there connect directly to the Shopify nodes in the workflow.

Can multiple team members use the same WhatsApp number to control the store?

Yes. The Simple Memory node isolates each conversation by WhatsApp phone number, so two managers messaging the same business number get completely separate conversation contexts. There is no cross-contamination. One manager asking about orders does not affect the other’s session. For team use, consider adding an authorization check at the start of the workflow to restrict commands to known wa_id numbers.

Which AI model should I use with OpenRouter for best results?

For store management tasks like structured queries, product lookups, order updates, Claude 3.5 Sonnet or GPT-4o Mini both perform excellently. Claude handles Arabic and French more naturally, making it the better choice if your team works in multiple languages. For pure speed and lowest cost, GPT-4o Mini is the most efficient. Avoid smaller models (7B parameters or less) as they tend to mis-call tools on complex multi-step commands.

Can I add more Shopify actions beyond what’s included?

Absolutely. n8n’s Shopify Tool node supports many additional operations: creating customers, managing fulfillments, updating inventory levels, and more. To add a new capability, duplicate one of the existing Shopify Tool nodes, change the operation, connect it to the AI Agent’s tools input, and add a brief description of what the tool does in the node’s description field, and the AI will use it automatically when appropriate.

What happens if the AI tries to delete the wrong product?

By design, the agent calls Get Products first to look up the product ID before deleting. However, there is no confirmation step in the base workflow. For production use, it is strongly recommended to add a safety layer: before the Delete node fires, send a WhatsApp message asking “Are you sure you want to delete [product name]? Reply YES to confirm.” Then use a Wait node and a conditional check on the reply before proceeding.

Can I connect this to a customer-facing WhatsApp number instead of an internal one?

The workflow as built is designed for internal store manager use. Connecting it to a customer-facing number would require a completely different system prompt and much stricter guardrails. The current prompt gives full write access to products and orders, which customers must never have. For a customer-facing chatbot, see our separate AI WooCommerce Chatbot guide which is designed specifically for that use case.

🚀 Get the n8n Shopify AI Agent Template

Download the ready-to-import workflow JSON, the Google Sheets order database template with all 14 columns pre-configured, and a step-by-step credential setup guide, so you can manage your Shopify store by WhatsApp voice in under 20 minutes.

Get the Template →

Instant download · Works on n8n Cloud and self-hosted

What’s Next?

  • Add a daily sales report: wire a Schedule Trigger that fires every morning and sends you a voice note summarizing the previous day’s orders, revenue, and top-selling products.
  • Add inventory alerts: extend the Get Products tool call to check stock levels and automatically send a WhatsApp alert when any product drops below a minimum quantity you define.
  • Connect Telegram as a second channel: duplicate the WhatsApp input/output nodes and replace them with Telegram nodes so the same AI agent is accessible from both apps with shared memory.
  • Add a safety confirmation step: before any destructive action (delete product, cancel order), add a WhatsApp reply asking for confirmation, then a Wait node and an IF check on the response.
  • Browse all our automation guides on the EasyWorkflows n8n blog →

How to Build an AI Customer Service Chatbot for Your WooCommerce Store with n8n

How to Build an AI Customer Service Chatbot for Your WooCommerce Store with n8n

New to n8n? Start with our step-by-step setup guide, then come back to build this workflow.

A multilingual AI agent that answers product questions, collects orders conversationally, and logs every buyer to Google Sheets, fully automated, zero code.

Running an online store means fielding the same questions at all hours: “Do you have this in my size?”, “How much does shipping cost?”, “Can I order online?” Every answer is manual, every missed message is a lost sale. This n8n workflow replaces that cycle with a multilingual AI agent that knows your entire WooCommerce product catalog in real time, handles customer conversations in Arabic, English, or French, collects order details when a buyer is ready, and writes everything to a Google Sheet for your fulfillment team, without you lifting a finger.

Prefer to skip the setup? Grab the ready-made template → and be up and running in under 10 minutes.

What You’ll Build

  1. A customer opens your store’s chat widget and sends a message, and the agent immediately asks which language they prefer (Arabic, English, or French).
  2. The AI queries your live WooCommerce product catalog in real time before answering any product question. It never guesses or invents details.
  3. If a product isn’t in stock, the agent politely asks whether the customer would like you to source it, then waits for a response.
  4. When the customer is ready to order, the agent collects their name, email, phone, address, country, and item through natural conversation, no form required.
  5. The order details are automatically appended to a Google Sheet row, ready for your fulfillment team to action.

How It Works: The Big Picture

The workflow has a single entry point, the n8n Chat Trigger, and routes every incoming message through an input guard before passing it to the AI agent. The agent has four tools it can call autonomously: a live product lookup, a Google Sheets writer, a calculator, and a “Think” reasoning step.

┌──────────────────────────────────────────────────────────────────────┐
│  AI ECOMMERCE CHATBOT (n8n)                                          │
│                                                                      │
│  [Chat Trigger] ──► [If: chatInput exists?]                         │
│                              │                                       │
│               ┌──────────────┴──────────────┐                       │
│            true (has input)             false (empty)               │
│               │                              │                       │
│               ▼                              ▼                       │
│      [Store Manager AI Agent]     [Respond to Webhook]              │
│       ┌───────┴────────┐          "How can I assist you?"           │
│       │   AI Tools:    │                                             │
│       │ • Get Products │ ◄── Live WooCommerce product data          │
│       │ • Customer DB  │ ──► Append row to Google Sheets            │
│       │ • Calculator   │ ◄── Price / quantity math                  │
│       │ • Think        │ ◄── Internal reasoning step                │
│       └───────┬────────┘                                             │
│               ▼                                                      │
│      [Respond to Webhook 1] ──► Customer sees AI reply in chat      │
└──────────────────────────────────────────────────────────────────────┘

What You’ll Need

  • n8n: self-hosted or n8n Cloud (any recent version)
  • WooCommerce store with REST API enabled and API keys generated
  • OpenRouter account: free tier available; choose your LLM (GPT-4o, Claude, Llama, etc.)
  • Google account with a Sheets spreadsheet set up as the customer database
  • A front-end chat widget that POSTs to an n8n webhook (the built-in n8n chat UI works out of the box)

Estimated build time: 45 to 60 minutes from scratch, or under 10 minutes with the ready-made template.

Part 1: Receiving and Validating the Message

1 When Chat Message Received (Chat Trigger)

This is the entry point of the entire workflow. n8n’s built-in Chat Trigger node opens a publicly accessible webhook endpoint and provides a ready-made chat UI you can embed anywhere. Every customer message fires this node and passes two fields downstream: chatInput (the message text) and sessionId (a unique ID tying all messages in one conversation together).

Set Public to true so the chat interface is accessible without authentication. Leave Initial Messages blank, the AI will send the first language-selection greeting itself.

// Data shape from the Chat Trigger
{
  "chatInput": "Do you carry trail running shoes?",
  "sessionId": "user_a8f3k2"
}
💡

Tip: Embed the widget on your store by copying the script URL from the Chat Trigger node and adding it to your theme’s footer. No plugin required.

2 If: Guard Against Empty Input

Browser pre-flight requests and widget load events can hit your webhook with an empty body. This If node checks whether $json.chatInput exists. If it does, the message goes to the AI agent. If not, a friendly default response fires immediately, with no wasted tokens, no errors.

📌

Note: The condition uses strict type validation and checks for exists, correctly handling null, undefined, or a missing key, all of which would otherwise crash the agent.

Part 2: The Store Manager AI Agent

3 Store Manager (AI Agent)

The Store Manager is the brain of the workflow, an n8n AI Agent node that reads the customer’s message, decides which tools to call, executes them, and formulates a natural-language response. Its entire behavior is controlled by the system prompt, which you can customize directly in the node settings.

The system prompt instructs the agent to:

  • Always open by asking for the customer’s preferred language (Arabic, English, or French)
  • Respond only in the chosen language for the rest of the conversation
  • Never invent product details. Always call Get Products first
  • Collect order information conversationally only after the customer expresses intent to buy
  • Keep responses short and human, with no JSON, no bullet lists unless asked
💡

Tip: The system prompt references the store name “MoroccoVibe”. Replace it with your own store name so the agent introduces itself correctly on the very first message.

4 OpenRouter (Language Model)

OpenRouter routes the agent to 100+ LLM providers. Switch between GPT-4o, Claude Sonnet, Mistral, Llama 3, and more by changing a single dropdown, with no other configuration needed. Add your OpenRouter API key in the credentials panel.

💡

Tip: For customer service, Claude 3 Haiku or GPT-4o Mini offer excellent quality at very low cost, typically under $0.01 per full conversation.

5 Simple Memory (Session Buffer)

The Simple Memory node gives the agent a 20-message conversation window keyed to each sessionId, so every customer’s chat is isolated and contextual. When a customer says “the second one you mentioned” four messages later, the agent knows exactly what they mean.

{
  "sessionKey": "{{ $json.sessionId }}",
  "contextWindowLength": 20
}

6 Get Products (WooCommerce Tool)

This tool gives the agent live, read-only access to your WooCommerce catalog. Whenever a customer asks about a product, the agent calls this tool automatically before answering, no hardcoded product lists, always fresh data. Connect your WooCommerce API credentials (Consumer Key + Consumer Secret) found under WooCommerce → Settings → Advanced → REST API.

📌

Note: If your store has more than 100 products, filter by search term rather than returning everything, since fetching the full catalog on every message adds latency and increases token cost.

7 Customer Database (Google Sheets Tool)

Once the agent has collected all six required fields, it calls this tool to append a new row to your Google Sheet. Column values are written using $fromAI() expressions, and the agent extracts each field from the conversation context and maps it directly, no manual field setup needed beyond the initial schema.

8 Think & Calculator (Reasoning Tools)

Think lets the agent reason internally before complex answers, useful for matching vague product descriptions or deciding whether to ask a clarifying question. Calculator handles all arithmetic (totals, discounts, unit quantities) to guarantee exact results and avoid LLM number drift.

The Data Structure

Create a Google Sheet with these exact column names before activating the workflow. The names are case-sensitive, and the agent uses them as keys when writing rows.

Column NameTypeExample ValueDescription
Items NameTextTrail Running Shoe, Size 10Product(s) the customer wants to order
Full NameTextJames CarterCustomer’s full name as provided in chat
Home addressText742 Evergreen Terrace, Springfield, IL 62704Full delivery address
Email AdresseTextjames.carter@gmail.comMatching key that prevents duplicate rows
Phone NumberText(555) 867-5309Contact number for delivery follow-up
CountryTextUnited StatesDestination country for shipping
NoteTextPrefers express shippingExtra notes from conversation (note the leading space in the column name)
📌

Important: Email Adresse is the matching key, so a second submission with the same email updates the existing row instead of creating a duplicate. The Note column has a leading space; keep this exactly as shown.

Full System Flow

Customer types in chat widget
          │
          ▼
[Chat Trigger] → { chatInput: "Do you carry trail running shoes?", sessionId: "user_a8f3k2" }
          │
          ▼
[If: chatInput exists?]
    │ true                            │ false
    ▼                                 ▼
[Store Manager Agent]       [Respond to Webhook] → "How can I assist you today?"
    │
    ├──► [Think] ← reasons about customer intent
    ├──► [Get Products] ← live WooCommerce catalog query
    │      └─ returns: [{ name: "Trail Runner Pro", price: "$89.00", stock: "In stock" }]
    ├──► (customer wants to order)
    │      [Customer Database] ← appends Google Sheet row:
    │        James Carter | james.carter@gmail.com | (555) 867-5309 | Springfield, IL | Trail Runner Pro
    └──► [Calculator] ← exact price/quantity arithmetic
          │
          ▼
[Respond to Webhook 1] → AI reply delivered to customer chat

Testing Your Workflow

  1. Click Test workflow in n8n, then open the Chat Trigger node and click Open Chat to launch the built-in test interface.
  2. Send “Hello” and verify the agent responds asking for language preference.
  3. Reply “English”, then ask about a real product in your WooCommerce store. Confirm the agent returns accurate, live data.
  4. Say “I’d like to buy it” and walk through the information collection. Verify all six fields are captured correctly.
  5. Open your Google Sheet and confirm a new row was appended with the correct data.
  6. Send an empty message to confirm the fallback route fires the default greeting.
ProblemLikely CauseFix
Agent says “I don’t have that information” WooCommerce API key has insufficient scope Ensure the key has Read access to products under WooCommerce → Settings → REST API
Google Sheet row not created Column names don’t match schema exactly Compare headers character-by-character, including the leading space in Note
Agent forgets earlier messages Session ID not passing through correctly Confirm the Chat Trigger is set to Public and sessionId is present in the payload
Agent responds in the wrong language Language wasn’t chosen on the first message Clear session memory and start a fresh conversation. Language selection must happen on message #1
No response in the chat widget Webhook response format mismatch Check that Respond to Webhook 1 is set to allIncomingItems

Frequently Asked Questions

Can I use a different AI model instead of OpenRouter?

Yes. The OpenRouter node is interchangeable with any n8n-supported language model: OpenAI, Anthropic, Google Gemini, Mistral, and others all work as drop-in replacements. Just swap the model node on the agent’s Chat Model input and reconnect the credential. Nothing else changes.

What languages does the chatbot support?

Out of the box: Arabic, English, and French. Add or remove languages by editing the list in the Store Manager system prompt, and the AI handles the rest as long as your chosen LLM supports those languages, which most modern models do.

Will the agent handle multiple customers simultaneously?

Yes. Each conversation is isolated by its sessionId. The Simple Memory node stores history per session key, so 50 simultaneous customers each get their own private conversation context with no cross-contamination.

What happens if a customer submits their info twice?

Since Email Adresse is the matching key, a second submission with the same email updates the existing row rather than creating a duplicate, keeping your sheet clean even if a customer changes their order details mid-conversation.

Does this work with WooCommerce variable products (sizes, colors)?

The Get Products node fetches product data including variations when available via the WooCommerce API. For more complex variant selection, consider adding a second WooCommerce node that fetches variations by product ID once the customer has chosen a base product.

Is the chat widget included in the template?

The n8n Chat Trigger provides a built-in widget accessible via a unique URL. Embed it in your WooCommerce theme as an iframe or script. Any front-end chat library that POSTs JSON to a webhook URL also works: Tidio, Crisp, or a fully custom implementation.

🚀 Get the AI Ecommerce Chatbot Template

Download the ready-to-import workflow JSON, the Google Sheets setup template, and a step-by-step credential guide. Everything you need to go live in under 10 minutes.

Get the Template →

Instant download · Works on n8n Cloud and self-hosted · 14-day refund guarantee

What’s Next?

  • Order confirmation emails: add a Gmail node after the Sheets tool to send an automated confirmation to the customer’s email the moment their details are saved.
  • Slack fulfillment alerts: ping your team channel with the customer name and item every time a new order row is created.
  • Inventory warnings: extend the WooCommerce tool call to check stock levels and proactively warn customers when an item is running low.
  • Multi-store support: duplicate the workflow and swap credentials to run the same agent for multiple storefronts, each with its own brand persona in the system prompt.
n8n WooCommerce AI Agent Google Sheets OpenRouter Customer Service Ecommerce Automation Multilingual Chatbot No Code