Handle WhatsApp event bookings with OpenAI and Google Sheets
Ready for 3.0What this workflow does
This AI workflow has 22 nodes and runs when an HTTP GET request hits its webhook URL. Along the way it connects OpenAI Chat Model, Google Sheets and Postgres Chat Memory.
How it runs
Trigger: When an HTTP GET request hits its webhook URL.
- Set config (Edit Fields (Set)): sets 4 fields: waha_api_url, waha_api_key, waha_session…
- Load the system prompt (Data table): get
- Message to our number? (If): checks a condition and branches into true / false
- Prepare customer message (Edit Fields (Set)): sets 4 fields: session, prompt, user_message…
- Sent by us? (If): checks a condition and branches into true / false
- Not our own chat? (If): checks a condition and branches into true / false
- Prepare our own message (Edit Fields (Set)): sets 3 fields: session, prompt, our_message
- Reply agent (AI Agent): runs an AI agent, with model: Chat model - Agent; 5 tools (All events tool, Save booking tool, Events by date tool, Image analysis tool…); memory: Conversation memory; output parser: Output Parser - Reply fields
- Should we reply? (If): checks a condition and branches into true / false
- Has an image? (If): checks a condition and branches into true / false
…plus 2 more steps. See the full node list below.
Services it uses
Other OpenAI + Google Sheets templates (2,011) · Other OpenAI + PostgreSQL templates (191) · Other Google Sheets + PostgreSQL templates (71)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (11)
- Webhook
n8n-nodes-base.webhook - If
n8n-nodes-base.if - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - AI Agent
@n8n/n8n-nodes-langchain.agent - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Google Sheets Tool
n8n-nodes-base.googleSheetsTool - HTTP Request
n8n-nodes-base.httpRequest - Data table
n8n-nodes-base.dataTable - Call n8n Workflow Tool
@n8n/n8n-nodes-langchain.toolWorkflow - Edit Fields (Set)
n8n-nodes-base.set - Postgres Chat Memory
@n8n/n8n-nodes-langchain.memoryPostgresChat
From the author
Quick overview This workflow receives inbound WhatsApp messages via a WAHA webhook, uses OpenAI with Postgres chat memory and Google Sheets tools to answer event and booking questions, and replies back over the WAHA API with either text or an image caption.…