Back to Integrations
integrationOpenAI node
integrationWhatsApp Business Cloud node

OpenAI and WhatsApp Business Cloud integration

Save yourself the work of writing custom integrations for OpenAI and WhatsApp Business Cloud and use n8n instead. Build adaptable and scalable AI, Langchain, Communication, and HITL workflows that work with your technology stack. All within a building experience you will love.

How to connect OpenAI and WhatsApp Business Cloud

  • Step 1: Create a new workflow
  • Step 2: Add and configure nodes
  • Step 3: Connect
  • Step 4: Customize and extend your integration
  • Step 5: Test and activate your workflow

Step 1: Create a new workflow and add the first step

In n8n, click the "Add workflow" button in the Workflows tab to create a new workflow. Add the starting point – a trigger on when your workflow should run: an app event, a schedule, a webhook call, another workflow, an AI chat, or a manual trigger. Sometimes, the HTTP Request node might already serve as your starting point.

OpenAI and WhatsApp Business Cloud integration: Create a new workflow and add the first step

Step 2: Add and configure OpenAI and WhatsApp Business Cloud nodes

You can find OpenAI and WhatsApp Business Cloud in the nodes panel. Drag them onto your workflow canvas, selecting their actions. Click each node, choose a credential, and authenticate to grant n8n access. Configure OpenAI and WhatsApp Business Cloud nodes one by one: input data on the left, parameters in the middle, and output data on the right.

OpenAI and WhatsApp Business Cloud integration: Add and configure OpenAI and WhatsApp Business Cloud nodes

Step 3: Connect OpenAI and WhatsApp Business Cloud

A connection establishes a link between OpenAI and WhatsApp Business Cloud (or vice versa) to route data through the workflow. Data flows from the output of one node to the input of another. You can have single or multiple connections for each node.

OpenAI and WhatsApp Business Cloud integration: Connect OpenAI and WhatsApp Business Cloud

Step 4: Customize and extend your OpenAI and WhatsApp Business Cloud integration

Use n8n's core nodes such as If, Split Out, Merge, and others to transform and manipulate data. Write custom JavaScript or Python in the Code node and run it as a step in your workflow. Connect OpenAI and WhatsApp Business Cloud with any of n8n’s 1000+ integrations, and incorporate advanced AI logic into your workflows.

OpenAI and WhatsApp Business Cloud integration: Customize and extend your OpenAI and WhatsApp Business Cloud integration

Step 5: Test and activate your OpenAI and WhatsApp Business Cloud workflow

Save and run the workflow to see if everything works as expected. Based on your configuration, data should flow from OpenAI to WhatsApp Business Cloud or vice versa. Easily debug your workflow: you can check past executions to isolate and fix the mistake. Once you've tested everything, make sure to save your workflow and activate it.

OpenAI and WhatsApp Business Cloud integration: Test and activate your OpenAI and WhatsApp Business Cloud workflow

AI-powered WhatsApp chatbot 🤖📲 for text, voice, images & PDFs with memory 🧠

This workflow is a highly advanced multimodal AI assistant designed to operate through WhatsApp. It can understand and respond to text, images, voice messages, and PDF documents by combining OpenAI models with smart logic to adapt to the content received.

🎯 Core Features

📥 1. Automatic Message Type Detection
Using the Input type node, the bot detects whether the user has sent:
Text
Voice messages
Images
Files (PDF)
Other unsupported content

💬 2. Smart Text Message Handling
Text messages are processed by an OpenAI GPT-4o-mini agent with a customized system prompt.
Replies are concise, accurate, and formatted for mobile readability.

🖼️ 3. Image Analysis & Description
Images are downloaded, converted to base64, and analyzed by an image-aware AI model.
The output is a rich, structured description, designed for visually impaired users or visual content interpretation.

🎙️ 4. Voice Message Transcription & Reply
Audio messages are downloaded and transcribed using OpenAI Whisper.
The transcribed text is analyzed and answered by the AI.
Optionally, the AI reply can be converted back to voice using OpenAI's text-to-speech, and sent as an audio message.

📄 5. PDF Document Extraction & Summary
Only PDFs are allowed (filtered via MIME type).
The document’s content is extracted and combined with the user's message.
The AI then provides a relevant summary or answer.

🧠 6. Contextual Memory
Each user has a personalized session ID with a memory window of 10 interactions.
This ensures a more natural and contextual conversation flow.

How It Works

Thisworkflow is designed to handle incoming WhatsApp messages and process different types of inputs (text, audio, images, and PDF documents) using AI-powered analysis. Here’s how it functions:

Trigger: The workflow starts with the **WhatsApp Trigger node, which listens for incoming messages (text, audio, images, or documents).
Input Routing: The **Input type (Switch node) checks the message type and routes it to the appropriate processing branch:
Text: Directly forwards the message to the AI agent for response generation.
Audio: Downloads the audio file, transcribes it using OpenAI, and sends the transcription to the AI agent.
Image: Downloads the image, analyzes it with OpenAI’s GPT-4 model, and generates a detailed description.
PDF Document: Downloads the file, extracts text, and processes it with the AI agent.
Unsupported Formats: Sends an error message if the input is not supported.
AI Processing: The AI Agent1 node, powered by OpenAI, processes the input (text, transcribed audio, image description, or PDF content) and generates a response.
Response Handling
:
For audio inputs, the AI’s response is converted back into speech (using OpenAI’s TTS) and sent as a voice message.
For other inputs, the response is sent as a text message via WhatsApp.
Memory: The **Simple Memory node maintains conversation context for follow-up interactions.

Setup Steps
To deploy this workflow in n8n, follow these steps:

Configure WhatsApp API Credentials:
Set up WhatsApp Business API credentials (Meta Developer Account).
Add the credentials in the WhatsApp Trigger, Get Image/Audio/File URL, and Send Message nodes.

Set Up OpenAI Integration:
Provide an OpenAI API key in the Analyze Image, Transcribe Audio, Generate Audio Response, and AI Agent1 nodes.

Adjust Input Handling (Optional):
Modify the Switch node ("Input type") to handle additional message types if needed.
Update the "Only PDF File" IF node to support other document formats.

Test & Deploy:
Activate the workflow and test with different message types (text, audio, image, PDF).
Ensure responses are correctly generated and sent back via WhatsApp.

Need help customizing?
Contact me for consulting and support or add me on Linkedin.

Nodes used in this workflow

Popular OpenAI and WhatsApp Business Cloud workflows

+7

AI-Powered WhatsApp Chatbot for Text, Voice, Images, and PDF with RAG

Who is this for? This template is designed for internal support teams, product specialists, and knowledge managers in technology companies who want to automate ingestion of product documentation and enable AI-driven, retrieval-augmented question answering via WhatsApp. What problem is this workflow solving? Support agents often spend too much time manually searching through lengthy documentation, leading to inconsistent or delayed answers. This solution automates importing, chunking, and indexing product manuals, then uses retrieval-augmented generation (RAG) to answer user queries accurately and quickly with AI via WhatsApp messaging. What these workflows do Workflow 1: Document Ingestion & Indexing Manually triggered to import product documentation from Google Docs. Automatically splits large documents into chunks for efficient searching. Generates vector embeddings for each chunk using OpenAI embeddings. Inserts the embedded chunks and metadata into a MongoDB Atlas vector store, enabling fast semantic search. Workflow 2: AI-Powered Query & Response via WhatsApp Listens for incoming WhatsApp user messages, supporting various types: Text messages: Plain text queries from users. Audio messages: Voice notes transcribed into text for processing. Image messages: Photos or screenshots analyzed to provide contextual answers. Document messages: PDFs, spreadsheets, or other files parsed for relevant content. Converts incoming queries to vector embeddings and performs similarity search on the MongoDB vector store. Uses OpenAI’s GPT-4o-mini model with retrieval-augmented generation to produce concise, context-aware answers. Maintains conversation context across multiple turns using a memory buffer node. Routes different message types to appropriate processing nodes to maximize answer quality. Setup Setting up vector embeddings Authenticate Google Docs and connect your Google Docs URL containing the product documentation you want to index. Authenticate MongoDB Atlas and connect the collection where you want to store the vector embeddings. Create a search index on this collection to support vector similarity queries. Ensure the index name matches the one configured in n8n (data_index). See the example MongoDB search index template below for reference. Setting up chat Authenticate the WhatsApp node with your Meta account credentials to enable message receiving and sending. Connect the MongoDB collection containing embedded product documentation to the MongoDB Vector Search node used for similarity queries. Set up the system prompt in the Knowledge Base Agent node to reflect your company’s tone, answering style, and any business rules, ensuring it references the connected MongoDB collection for context retrieval. Make sure Both MongoDB nodes (in ingestion and chat workflows) are connected to the same collection with: An embedding field storing vector data, Relevant metadata fields (e.g., document ID, source), and The same vector index name configured (e.g., data_index). Search Index Example: { "mappings": { "dynamic": false, "fields": { "_id": { "type": "string" }, "text": { "type": "string" }, "embedding": { "type": "knnVector", "dimensions": 1536, "similarity": "cosine" }, "source": { "type": "string" }, "doc_id": { "type": "string" } } } }
+2

AI-Powered WhatsApp Chatbot 🤖📲 for Text, Voice, Images & PDFs with memory 🧠

This workflow is a highly advanced multimodal AI assistant designed to operate through WhatsApp. It can understand and respond to text, images, voice messages, and PDF documents by combining OpenAI models with smart logic to adapt to the content received. 🎯 Core Features 📥 1. Automatic Message Type Detection Using the Input type node, the bot detects whether the user has sent: Text Voice messages Images Files (PDF) Other unsupported content 💬 2. Smart Text Message Handling Text messages are processed by an OpenAI GPT-4o-mini agent with a customized system prompt. Replies are concise, accurate, and formatted for mobile readability. 🖼️ 3. Image Analysis & Description Images are downloaded, converted to base64, and analyzed by an image-aware AI model. The output is a rich, structured description, designed for visually impaired users or visual content interpretation. 🎙️ 4. Voice Message Transcription & Reply Audio messages are downloaded and transcribed using OpenAI Whisper. The transcribed text is analyzed and answered by the AI. Optionally, the AI reply can be converted back to voice using OpenAI's text-to-speech, and sent as an audio message. 📄 5. PDF Document Extraction & Summary Only PDFs are allowed (filtered via MIME type). The document’s content is extracted and combined with the user's message. The AI then provides a relevant summary or answer. 🧠 6. Contextual Memory Each user has a personalized session ID with a memory window of 10 interactions. This ensures a more natural and contextual conversation flow. How It Works Thisworkflow is designed to handle incoming WhatsApp messages and process different types of inputs (text, audio, images, and PDF documents) using AI-powered analysis. Here’s how it functions: Trigger: The workflow starts with the **WhatsApp Trigger node, which listens for incoming messages (text, audio, images, or documents). Input Routing: The **Input type (Switch node) checks the message type and routes it to the appropriate processing branch: Text: Directly forwards the message to the AI agent for response generation. Audio: Downloads the audio file, transcribes it using OpenAI, and sends the transcription to the AI agent. Image: Downloads the image, analyzes it with OpenAI’s GPT-4 model, and generates a detailed description. PDF Document: Downloads the file, extracts text, and processes it with the AI agent. Unsupported Formats: Sends an error message if the input is not supported. AI Processing: The **AI Agent1 node, powered by OpenAI, processes the input (text, transcribed audio, image description, or PDF content) and generates a response. Response Handling**: For audio inputs, the AI’s response is converted back into speech (using OpenAI’s TTS) and sent as a voice message. For other inputs, the response is sent as a text message via WhatsApp. Memory: The **Simple Memory node maintains conversation context for follow-up interactions. Setup Steps To deploy this workflow in n8n, follow these steps: Configure WhatsApp API Credentials: Set up WhatsApp Business API credentials (Meta Developer Account). Add the credentials in the WhatsApp Trigger, Get Image/Audio/File URL, and Send Message nodes. Set Up OpenAI Integration: Provide an OpenAI API key in the Analyze Image, Transcribe Audio, Generate Audio Response, and AI Agent1 nodes. Adjust Input Handling (Optional): Modify the Switch node ("Input type") to handle additional message types if needed. Update the "Only PDF File" IF node to support other document formats. Test & Deploy: Activate the workflow and test with different message types (text, audio, image, PDF). Ensure responses are correctly generated and sent back via WhatsApp. Need help customizing? Contact me for consulting and support or add me on Linkedin.
+8

Automated HR Service System with WhatsApp, GPT-4 Classification & Google Workspace

Who is this for? This workflow is ideal for HR teams, startups, and enterprises that want to handle employee interactions through WhatsApp and automate responses using LLM (OpenAI) and intelligent routing. What problem is this workflow solving? Managing WhatsApp messages manually can be time-consuming and error-prone. This workflow solves that by: Auto-classifying messages using LLM Routing them to the right AI-powered agent Automating leave approvals, attendance, HR FAQs, complaints, and candidate shortlisting Delivering final responses interactively via WhatsApp What this workflow does WhatsApp Trigger captures incoming messages LLM Classification analyzes message intent and outputs category (1–5) Switch Node routes the message to the correct agent: 1 → Leave Agent 2 → HR FAQ Chatbot 3 → Attendance Agent 4 → Complaint/Request Agent 5 → Shortlisting Agent Each agent performs specific tasks using tools like: Google Sheets (fetch dept head emails, JD/applicants, logs) Google Calendar (schedule meetings) Vector Search (for policy embeddings) OpenAI (transcription, classification, chatbot) Final WhatsApp Response node sends updates and interactive options to the user Setup Connect WhatsApp API (e.g., via Twilio or WhatsApp Business Cloud API) Configure OpenAI credentials Set up Google Sheets with: Employee data JD and applicants info Policy documents (for embedding) Prepare Google Calendar access Create a vector store with embedded company policy docs How to customize this workflow to your needs Update the LLM prompt to suit your company’s categories or expand to more intents Replace sample sheets with your organization’s actual data Train your own policy embeddings if needed Add/modify agents (e.g., Payroll Bot, IT Support Bot) by cloning an existing pattern Adjust the Switch Node if you add more classifications With this modular and intelligent setup, you can turn your WhatsApp into a smart HR & operations assistant powered by AI, accessible 24/7.
+3

Auto-Generate WhatsApp Proposals from Voice or Text using GPT & APITemplate

How it works • Transcribes a WhatsApp voice or text message from a prospect using Whisper or GPT • Extracts key information (name, need, context, urgency) via AI • Matches the most relevant service pack by comparing the prospect’s need with Airtable data • Dynamically fills a branded template via APITEMPLATE (HTML or PDF) • Generates a clean, personalized business proposal — including dynamic links (payment, calendar, etc.) • Sends the final PDF back instantly via WhatsApp or email Set up steps • ⏱ Estimated setup time: 45–60 minutes • ✅ You’ll need:  ◦ WhatsApp Business Cloud API access (with webhook configured)  ◦ OpenAI API key (Whisper + GPT)  ◦ Airtable (to store service packs and client input)  ◦ APITEMPLATE account (template with placeholders like {{nom}}, {{prix}}, {{lien_reservation}}, etc.)  ◦ n8n instance (cloud or self-hosted) • 📦 Create your service packs in Airtable with associated links (Stripe, Calendly…) • 🔗 The proposal auto-includes these links dynamically inside the PDF • 🚀 Workflow orchestrates the end-to-end process: from WhatsApp input to PDF delivery
+2

Manage Emails via WhatsApp with Gmail, GPT and Voice Recognition

🔍 How it works This workflow turns WhatsApp into a smart email command center using AI. Users can speak or type instructions like: "Send a follow-up to Claire” "Write a draft email to Claire to confirm tomorrow’s meeting at 5 PM” "What is the name of Claire's firm?” The agent transcribes voice notes, extracts intent with GPT, interacts with Gmail (send, draft, search), and replies with a confirmation via WhatsApp — either as text or a voice message. ⚙️ Key Modules Used WhatsApp Business Webhook (Meta) OpenAI Whisper (voice transcription) GPT (intent + content generation) Gmail (search, draft, send) Airtable (contact lookup + memory logging) 🧠 Memory Layer (Optional) The agent logs key fields in Airtable: Recipient email Company / job title And more... This creates a lightweight "gut memory” so the agent feels context-aware. 🗺️ Setup Steps Connect WhatsApp Business API (via Meta Developer Console) Add OpenAI and Gmail credentials in n8n Link your Airtable base for contacts and logging 🧩 Best Use Cases Hands-free email reply while commuting Fast Gmail access for busy consultants / solopreneurs Custom business agents for service-based professionals ⏱️ Estimated Setup Time 30–60 minutes ✅ Requirements WhatsApp Business Cloud access OpenAI API Key Gmail or Google Workspace Airtable account (free plan OK) n8n instance (cloud or self-hosted with HTTPS)
+7

AI Sales Agent: WhatsApp, FB, IG, OpenAI, Airtable, Supabase Auto-Booking

This workflow automates multi-channel AI-driven sales engagement for lead qualification, service information delivery, and consultation booking. It integrates WhatsApp, Facebook Messenger, Instagram DM, and an n8n chat interface with a backend CRM (Airtable), a knowledge base (Supabase), and conversational AI (OpenAI), all orchestrated by n8n. Tools & Services Used Messaging Platforms: WhatsApp, Facebook Messenger, Instagram DM, n8n Built-in Chat AI Core & Processing: OpenAI (GPT-4o for main agent logic, Whisper for audio transcription) CRM & Data Management: Airtable (for initial WhatsApp lead lookup, lead form submissions, and as the backend for the crmAgent sub-workflow operations) Knowledge Base: Supabase (Vector Store for technical_and_sales_knowledge tool) Chat Memory: PostgreSQL (for the main AI Agent's conversation history) Orchestration & Automation: n8n (Self-hosted, utilizing Langchain community nodes) Calendar Service: Integrated via the calendarAgent sub-workflow CRM Service: Integrated via the crmAgent sub-workflow (interacting with Airtable) Workflow Overview This automation performs the following steps: Trigger: A new interaction is initiated through one of the following channels: A new message is received via the WhatsApp Trigger. A new message is received via the Facebook Trigger (Webhook). A new message is received via the Instagram Trigger (Webhook). A new message is received via the n8n Chat Trigger. Alternatively, a new lead is submitted via the Airtable Form Submitted Webhook. Channel-Specific Ingestion & Pre-processing: For WhatsApp: The system attempts to find an existing lead in Airtable using the sender's phone number. Incoming messages are routed by the Handle Message Types switch: Text messages are passed to the Edit Fields - chat1 node to prepare input for the AI Agent, including any found lead information. Audio messages are processed: the WhatsApp Business Cloud node gets the media URL, the HTTP Request node downloads the audio, OpenAI transcribes it to text, and Edit Fields - chat2 prepares this transcribed text and lead information for the AI Agent. Unsupported message types trigger the Reply To User1 node to send a notification that the message type cannot be processed. For Facebook Messenger: The system responds to webhook verification (Respond to Webhook - facebook get) and acknowledges new messages (Respond to Webhook - facebook post). The If is not echo - facebook node filters out messages sent by the page. The Sales Agent Demo - typing_on node sends a typing indicator. The Edit Fields - facebook node prepares the message text, sender ID, and Facebook-specific context for the AI Agent. For Instagram DM: The system responds to webhook verification (Respond to Webhook - instagram get) and acknowledges new messages (Respond to Webhook - instagram post). The If is not echo - instagram node filters out messages sent by the business account. The Edit Fields - instagram node prepares the message text, sender ID, and Instagram-specific context for the AI Agent. For n8n Chat: The Edit Fields - chat node prepares the user's input and session information for the AI Agent. Input Aggregation for AI Agent: Processed data from all active messaging channels (WhatsApp text/audio, Facebook, Instagram, n8n Chat) is funneled through the No Operation, do nothing node to the main AI Agent. AI Sales Conversation & Tool Utilization: The AI Agent (using OpenAI Chat Model - GPT-4o, and Postgres Chat Memory) engages the user according to its system prompt, aiming to qualify them for Paint Protection Film (PPF), Ceramic Coating, or Window Tint. The AI Agent uses the technical_and_sales_knowledge tool (which queries the Demo Supabase vector store via Embeddings OpenAI and OpenAI Chat Model1) to provide service details and answer questions. The AI Agent uses the crmAgent tool (a sub-workflow) to log contact details (Name, Email, service interest) and update opportunity statuses in Airtable. The AI Agent uses the calendarAgent tool (a sub-workflow) to book consultation appointments once preferred dates/times are provided. This occurs after contact details are logged in the CRM. Response Delivery: The AI Agent's final textual response is passed to the Switch node. The Switch node routes the response to the appropriate node for delivery on the original channel: Reply To User for WhatsApp. Facebook Graph API - Sales Agent Demo for Facebook Messenger. Instagram Graph API - smb.sales.agent.demo for Instagram DM. Output - chat for the n8n Chat interface. Airtable Form Submission Processing (Separate Branch): When the Airtable Form Submitted webhook receives data, the Airtable node fetches the full record. The Create Contact node creates a new contact in the Airtable 'Contacts' table. The Edit Fields - form node prepares data for a notification. The WhatsApp Business Cloud2 node sends a templated WhatsApp message to the lead, confirming their form submission.

Build your own OpenAI and WhatsApp Business Cloud integration

Create custom OpenAI and WhatsApp Business Cloud workflows by choosing triggers and actions. Nodes come with global operations and settings, as well as app-specific parameters that can be configured. You can also use the HTTP Request node to query data from any app or service with a REST API.

OpenAI supported actions

Message a Model
Generate a model response with GPT 3, 4, 5, etc. using Responses API
Classify Text for Violations
Check whether content complies with usage policies
Analyze Image
Take in images and answer questions about them
Generate an Image
Creates an image from a text prompt
Edit Image
Edit an image
Generate Audio
Creates audio from a text prompt
Transcribe a Recording
Transcribes audio into text
Translate a Recording
Translates audio into text in English
Delete a File
Delete a file from the server
List Files
Returns a list of files that belong to the user's organization
Upload a File
Upload a file that can be used across various endpoints
Create
Create a conversation
Get
Get a conversation
Remove
Remove a conversation
Update
Update a conversation
Generate
Creates a video from a text prompt

WhatsApp Business Cloud supported actions

Send
Send and Wait for Response
Send Template
Upload
Download
Delete

OpenAI and WhatsApp Business Cloud integration details

FAQs

  • Can OpenAI connect with WhatsApp Business Cloud?

  • Can I use OpenAI’s API with n8n?

  • Can I use WhatsApp Business Cloud’s API with n8n?

  • Is n8n secure for integrating OpenAI and WhatsApp Business Cloud?

  • How to get started with OpenAI and WhatsApp Business Cloud integration in n8n.io?

Need help setting up your OpenAI and WhatsApp Business Cloud integration?

Discover our latest community's recommendations and join the discussions about OpenAI and WhatsApp Business Cloud integration.
Artem
sérgio eduardo floresta filho
Andrew adawdad
PinkFloyd
Steve Warburton

Looking to integrate OpenAI and WhatsApp Business Cloud in your company?

Over 3000 companies switch to n8n every single week

Why use n8n to integrate OpenAI with WhatsApp Business Cloud

Build complex workflows, really fast

Build complex workflows, really fast

Handle branching, merging and iteration easily.
Pause your workflow to wait for external events.

Code when you need it, UI when you don't

Simple debugging

Your data is displayed alongside your settings, making edge cases easy to track down.

Use templates to get started fast

Use 1000+ workflow templates available from our core team and our community.

Reuse your work

Copy and paste, easily import and export workflows.

Implement complex processes faster with n8n

red iconyellow iconred iconyellow icon