Automate Order Status: Build an AI Chatbot on WhatsApp with 2Chat, n8n, & Google Sheets
Build a WhatsApp AI chatbot for instant order status! Automate customer service with 2Chat, n8n, & Google Sheets. Perfect for businesses, startups, & marketers.

As a business owner, digital marketing professional, or startup founder, you know the drill: the phone rings, emails pile up, and your team spends countless hours answering the same questions about order statuses. While keeping customers informed is crucial, this repetitive task can drain valuable resources and pull your team away from critical growth initiatives.
But what if your customers could get instant, accurate updates on their orders 24/7, directly on WhatsApp, without a single human touch?
Imagine freeing up your customer service agents to handle more complex issues, nurturing leads, or focusing on personalized outreach. This isn't a futuristic fantasy; it's a tangible reality with the power of AI chatbots integrated into your existing systems.
In this comprehensive tutorial, we'll walk you through building a powerful AI chatbot on WhatsApp that connects directly to your Google Sheets data. We'll leverage 2Chat for seamless WhatsApp integration, n8n as your robust automation backbone, and of course, Google Sheets as your flexible data repository. Get ready to supercharge your customer service and give your business a competitive edge!
You will need:
- 2Chat account
- n8n account to upload this template
The Foundation: Your Google Sheet Data
Our chatbot will rely on a simple yet effective data source: a Google Sheet template. This keeps things accessible and easy to manage, especially for startups and small businesses.
Your Google Sheet should contain essential order information. In our example, we use the following columns:
- Order ID: The unique identifier for each order.
- Order Status: Current status (e.g., "Received," "In Transit," "Delivered," "With Issues").
- Notes: Any relevant details about the order.
- Customer Name: The name of the customer.
- Delivery Date: The estimated or actual delivery date.
Pro-Tip for Entrepreneurs: The beauty here is flexibility! You can easily add more columns to your Google Sheet (e.g., product details, tracking links, special instructions). The AI agent is smart enough to leverage any relevant information you provide, making your chatbot even more powerful over time.
How the Magic Happens: The n8n Workflow
At the heart of our intelligent chatbot lies n8n, an open-source workflow automation tool. Think of n8n as the "brain" that connects different services and orchestrates the entire process. It receives the WhatsApp message, understands what the customer wants, fetches the data, and prepares the response.

Here's a breakdown of the n8n workflow components:
The Webhook – Your Chatbot's Listening Ear:
This is the entry point. When a customer sends a message on WhatsApp, 2Chat will trigger this webhook. It acts as a secure bridge, receiving the customer's message and phone number, and passing them to the AI agent.
The AI Agent – The Brain of Your Chatbot:
This is where the artificial intelligence comes into play. The AI Agent takes the customer's raw message and processes it.
System Prompt: This is a set of instructions you give the AI to define its role and behavior. For our order status chatbot, the prompt tells the AI to act as a customer service assistant, focus on retrieving order information, and maintain a professional and supportive tone. This prompt is crucial for guiding the AI's responses.
**Situation**
You are a customer service AI assistant specializing in order information retrieval for a company's purchase order system. Customers interact with you to obtain specific details about their orders.
**Task**
Retrieve and display precise order information when a customer provides a valid order number. Verify the order number's authenticity and provide a comprehensive yet concise order status report.
**Objective**
Deliver accurate, transparent, and helpful order information to enhance customer satisfaction and support efficient customer service interactions.
**Knowledge**
- Required input: Valid Order Number
- Available order information fields:
1. OrderID
2. OrderStatus
3. Notes
4. CustomerName
5. DeliveryDate
- Strict validation required for order number input
- Protect customer data privacy
**Constraints**
- Only respond with order details if a valid order number is provided
- Do not fabricate or guess order information
- If order number is invalid, return a clear, apologetic message explaining the issue
**Response Guidelines**
1. Confirm the order number's validity
2. If valid, display all available order information in a clear, structured format
3. If invalid, provide a helpful guidance message
4. Maintain a professional and supportive tone throughout the interaction
**Error Handling**
- If no order number is provided, prompt the customer to enter their order number
- If multiple order numbers are entered, request clarification
- Ensure no sensitive information is disclosed inappropriately
AI Model (e.g., OpenAI GPT-4.1-mini): The AI Agent uses a powerful language model (like GPT-4.1-mini, or any other compatible model you choose) to understand natural language, extract key information (like the order ID), and generate human-like responses.
Simple Memory: This component gives your chatbot short-term memory. It remembers the last few interactions with a specific customer (identified by their WhatsApp phone number). This allows for a more fluid conversation, so customers don't have to repeat themselves.
Google Sheets Integration – Fetching the Data:
After the AI Agent understands the customer's request and identifies an order ID, it uses this Google Sheets integration node to retrieve the relevant row from your "2Chat Order Status" sheet.
It's configured to search specifically by the "Order ID" column. The remarkable part is that the AI automatically extracts the order ID from the conversation, even if the customer phrases their request differently each time.
As mentioned earlier, you can add more columns to your Google Sheet, and the AI agent, guided by its prompt, can incorporate that new information into its responses!
Respond to Webhook – Sending Info Back:
Once the order information is retrieved and processed by the AI Agent into a user-friendly message, this node sends the final response back to 2Chat, which then forwards it to the customer on WhatsApp.
Bringing it to Life: 2Chat Integration
2Chat is your platform for managing WhatsApp Business API conversations. It serves as the bridge between your customers' WhatsApp messages and your n8n workflow.
Here’s how you set up the conversation flow in 2Chat:

Initial Step (Trigger):
You start by defining when the flow should be triggered. In this case, it's "When a new message is received" from your "2Chat Virtual Assistant" WhatsApp channel. This ensures that every incoming customer message starts the process.
Make an HTTP Request:
This is the critical link to your n8n workflow. You'll set up an HTTP POST request pointing to the Production URL of your n8n Webhook.
In the request body (JSON format), you'll send two crucial pieces of information from 2Chat to n8n:
- last_user_message: Contains the actual text message sent by the customer (using 2Chat's {{message}} variable).
- from_number: Contains the customer's WhatsApp phone number (using 2Chat's {{wa.phoneNumber()}} variable). This is vital for the "Simple Memory" in n8n.
Handle the Response & Send Message:
Once n8n processes the request and sends back the AI's response, 2Chat captures this. You'll map the output from n8n's response to a Custom Field in 2Chat, let's call it agentmessage. Finally, a "Send Message and Wait for Reply" component uses this agentmessage custom field to send the AI's tailored response directly back to the customer on WhatsApp. The "Wait for Reply" part is key: it keeps the conversation loop active, ready for the customer's next message, and feeds it back into the n8n flow.
Key Takeaways for Your Business
Building an AI order status chatbot is more than just a tech novelty; it's a strategic move for your business:
- Boost Operational Efficiency: Dramatically reduce the time and effort spent on repetitive customer inquiries.
- Elevate Customer Experience: Offer immediate, personalized support that sets you apart from competitors.
- Empower Your Team: Free up human agents to focus on complex problem-solving, sales, and nurturing relationships.
- Leverage Existing Data: Turn your Google Sheets into a dynamic, interactive customer service tool.
- Future-Proof Your Support: Lay the groundwork for more advanced AI-driven customer interactions.
This powerful combination of 2Chat, n8n, and Google Sheets offers a scalable, efficient, and intelligent solution for managing customer order inquiries. It's time to transform your customer service from a cost center into a true competitive advantage!
Ready to streamline your customer service and leverage the power of AI on WhatsApp? Sign up for a 2Chat account today and start building your smart chatbot! Visit: 2chat.co