Handle WhatsApp orders, FAQs, and tracking with GPT-4o, Pinecone, and Sheets

Go to Workflow
0 views
Built by WeblineIndia WeblineIndia
Created on June 13, 2026

Description

Quick Overview
This workflow builds a WhatsApp business assistant that uses OpenAI to classify incoming messages and route them to FAQ answers via Pinecone RAG, order placement and inventory updates in Google Sheets, order-status lookups, or Slack escalation for human support, with a Google Drive-to-Pinecone knowledge sync.

How it works
Triggers when a new WhatsApp message is received and extracts the sender phone number, message text, and a timestamp.
Uses OpenAI (GPT-4o) to classify the message intent as FAQ, ORDER, TRACK_ORDER, or HUMAN_SUPPORT and routes the request accordingly.
For FAQ requests, retrieves relevant context from a Pinecone vector index and uses OpenAI to draft a short WhatsApp-style answer, then replies via WhatsApp.
For ORDER requests, uses OpenAI to extract product and quantity, matches the request semantically against a Google Sheets product catalog, and validates the matched product.
If the product is found and stock is sufficient, appends a new order row to a Google Sheets Orders sheet, updates stock in the Products sheet, and sends an order confirmation via WhatsApp.
If the product is not found or stock is insufficient, sends an error/out-of-stock message via WhatsApp.
For TRACK_ORDER requests, uses OpenAI to extract the order ID, looks up the order in Google Sheets, and replies with the current status via WhatsApp.
For HUMAN_SUPPORT requests, posts the customer message details to a Slack channel and sends an acknowledgement back to the customer on WhatsApp.

Setup
Configure WhatsApp Cloud API credentials in n8n and ensure your WhatsApp app is set to send message webhooks to the workflow trigger URL.
Add OpenAI API credentials for intent classification, order extraction, semantic matching, order ID extraction, and FAQ response generation.
Set up Google Sheets OAuth credentials and update the spreadsheet/document ID and sheet tabs for Products and Orders to match your own schema (including product_id, product_name, stock, and order_id fields).
Create a Pinecone index (and namespace) compatible with OpenAI embeddings and add Pinecone API credentials, then populate it with your knowledge base content.
Add Google Drive OAuth credentials and select the knowledge base file to watch so updates are downloaded, chunked, embedded, and stored in Pinecone.
Add Slack API credentials and choose the target channel ID where human support requests should be posted.

Nodes Used (14)

AI Agent
@n8n/n8n-nodes-langchain.agent
Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter
Code
n8n-nodes-base.code
Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader
Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi
Google Drive
n8n-nodes-base.googleDrive
Google Sheets
n8n-nodes-base.googleSheets
OpenAI
@n8n/n8n-nodes-langchain.openAi
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Pinecone Vector Store
@n8n/n8n-nodes-langchain.vectorStorePinecone
Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow
Slack
n8n-nodes-base.slack
Vector Store Question Answer Tool
@n8n/n8n-nodes-langchain.toolVectorStore
WhatsApp Business Cloud
n8n-nodes-base.whatsApp