Back to Integrations
integrationFacebook Graph API node
integrationWhatsApp Business Cloud node

Facebook Graph API and WhatsApp Business Cloud integration

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

How to connect Facebook Graph API 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.

Facebook Graph API and WhatsApp Business Cloud integration: Create a new workflow and add the first step

Step 2: Add and configure Facebook Graph API and WhatsApp Business Cloud nodes

You can find Facebook Graph API 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 Facebook Graph API and WhatsApp Business Cloud nodes one by one: input data on the left, parameters in the middle, and output data on the right.

Facebook Graph API and WhatsApp Business Cloud integration: Add and configure Facebook Graph API and WhatsApp Business Cloud nodes

Step 3: Connect Facebook Graph API and WhatsApp Business Cloud

A connection establishes a link between Facebook Graph API 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.

Facebook Graph API and WhatsApp Business Cloud integration: Connect Facebook Graph API and WhatsApp Business Cloud

Step 4: Customize and extend your Facebook Graph API 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 Facebook Graph API and WhatsApp Business Cloud with any of n8n’s 1000+ integrations, and incorporate advanced AI logic into your workflows.

Facebook Graph API and WhatsApp Business Cloud integration: Customize and extend your Facebook Graph API and WhatsApp Business Cloud integration

Step 5: Test and activate your Facebook Graph API 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 Facebook Graph API 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.

Facebook Graph API and WhatsApp Business Cloud integration: Test and activate your Facebook Graph API and WhatsApp Business Cloud workflow

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.

Nodes used in this workflow

Popular Facebook Graph API and WhatsApp Business Cloud workflows

+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.
+4

Recover Shopify Abandoned Carts with Email, SMS, WhatsApp & Facebook Retargeting

This workflow is a complete, production-ready solution for recovering abandoned carts in Shopify stores using a multi-channel, multi-touch approach. It automates personalized follow-ups via Email, SMS, and WhatsApp, tracks every customer interaction for multi-touch attribution, and enables advanced retargeting and analytics. Key features: Multi-step, timed recovery sequence (Email → SMS → Email → WhatsApp) Customer segmentation (new, returning, VIP) and A/B testing Dynamic discounting and personalized messaging Touchpoint logging to Google Sheets for attribution analysis Facebook Custom Audience retargeting for unrecovered carts Slack notifications for high-value cart recoveries What does this workflow do? Listens for abandoned cart events from Shopify (or any e-commerce platform) via webhook. Normalizes and enriches cart data by fetching full cart details and customer purchase history. Predicts the likely reason for abandonment (e.g., price sensitivity, checkout complexity, technical issues) using rule-based logic. Segments the customer (new, returning, VIP), assigns an A/B test group, and generates a personalized discount and checkout URL. Runs a timed, multi-channel recovery sequence: 1 hour after abandonment: Checks if the order is completed. If not, sends a personalized Email #1 and logs the touchpoint. 4 hours after abandonment: Checks again. If not recovered, sends an SMS with a discount code and logs the touchpoint. 24 hours after abandonment: Checks again. If not recovered, sends Email #2 (with social proof/urgency) and logs the touchpoint. 48 hours after abandonment: Final check. If not recovered, sends a WhatsApp reminder and logs the touchpoint. If the cart is still not recovered: Hashes customer identifiers and adds them to a Facebook Custom Audience for retargeting. Logs every touchpoint (email, SMS, WhatsApp) to a Google Sheet for multi-touch attribution analysis. Sends a Slack notification if a high-value cart is recovered. Why is this workflow useful? Boosts recovery rates:** By using multiple channels and personalized timing, you maximize the chance of recovering lost sales. Improves attribution:** Every customer interaction is logged, so you can analyze which channels and messages drive conversions. Enables advanced retargeting:** Unrecovered carts are automatically added to a Facebook Custom Audience for paid retargeting. Saves time:** Fully automated, with easy configuration for your store, messaging, and analytics. Scalable and extensible:** Easily adapt the sequence, add more channels, or integrate with other tools. How to install and configure Prerequisites n8n instance (v2.0.2+ recommended) Shopify store with API access Accounts and API credentials for: SendGrid (email) Twilio (SMS) WhatsApp Business API Google Sheets (service account) Facebook Graph API (for Custom Audiences) Slack (for notifications) Setup steps Import the workflow into your n8n instance. Configure the “Workflow Configuration” node: Set your Shopify domain, API URLs, Google Sheets ID, and high-value threshold. Connect all required credentials in the respective nodes: Shopify, SendGrid, Twilio, WhatsApp, Google Sheets, Facebook Graph API, Slack. Create a Google Sheet named “Touchpoints” with columns: cart_id, customer_id, touchpoint_type, timestamp, channel, ab_group. Set up the webhook in your Shopify store (or e-commerce platform) to trigger the workflow on cart abandonment. Test the workflow with a sample abandoned cart event to ensure emails, SMS, WhatsApp, and logging work as expected. Enable the workflow in n8n for live operation. Node-by-node breakdown Abandoned Cart Webhook:** Receives abandoned cart events. Workflow Configuration:** Stores global settings (API URLs, Shopify domain, Google Sheets ID, high-value threshold). Normalize Cart Data:** Cleans and standardizes incoming cart data. Fetch Cart Details / Fetch Customer History:** Enriches data with full cart and customer info. Predict Abandonment Reason:** Uses business logic to guess why the cart was abandoned. Personalization Engine:** Segments the customer, assigns A/B group, calculates discount, and builds checkout URL. Customer Segment Check / Device Type Check:** Applies routing logic for personalized messaging. Wait / Check Order Status / Generate & Send Messages:** Timed sequence for Email, SMS, and WhatsApp, with order status checks at each step. Log Touchpoint (Google Sheets):** Records every message sent for attribution. Attribution Merge:** Combines all touchpoints into a single journey for analysis. Hash Customer Data for Facebook / Add to Retargeting Audience:** Adds unrecovered carts to a Facebook Custom Audience. Check Cart Value Threshold / Notify High-Value Recovery:** Sends Slack alerts for high-value recoveries. Customization tips Adjust wait times and message content to fit your brand and audience. Add or remove channels (e.g., push notifications, phone calls) as needed. Expand the Google Sheet for deeper analytics (e.g., add UTM parameters, campaign IDs). Integrate with your CRM or analytics platform for end-to-end tracking. Troubleshooting Make sure all API credentials are set and tested. Check Google Sheets permissions for the service account. Test each channel (email, SMS, WhatsApp) individually before going live. Review the workflow execution logs in n8n for errors or failed steps.
+12

Multi-Platform AI Sales Agent with RAG, CRM Logging & Appointment Booking

Multi-Platform AI Sales Agent with RAG, CRM Logging & Appointment Booking This workflow acts as a 24/7 sales agent, engaging leads across WhatsApp, Instagram, Facebook, Telegram, and your website. It intelligently transcribes audio messages, answers questions using a knowledge base, and uses modular sub-workflows to manage your CRM in Airtable and book appointments in Google Calendar. Who Is It For? This solution is designed for service-based businesses that require a sophisticated, multi-channel lead management and appointment booking system. Agencies, consultants, and clinics** looking to automate lead qualification and booking across text and voice messages. Sales teams** needing a robust system that separates CRM and calendar logic for easier management and scalability. Advanced n8n users** who want a powerful, agent-based framework that can be easily customized and extended. Key Features & Workflow This system is composed of a parent workflow that orchestrates the conversation and calls specialized sub-workflows (agents) to perform specific tasks. Omni-Channel Engagement:* Greets and converses with leads naturally on Website Chat, WhatsApp, Instagram, Facebook, and Telegram*. Voice Message Transcription:* Automatically transcribes incoming audio/voice notes from WhatsApp and Telegram* into text, allowing the AI to understand and respond without manual intervention. RAG-Powered Intelligence:* The AI agent draws answers from your dedicated PostgreSQL Knowledge Base (RAG)*, providing accurate information about your services, pricing, and process. A built-in tool allows you to load new knowledge documents from Google Drive. Modular CRM Agent (Sub-Workflow):* When the conversation requires CRM actions (like creating a contact or updating an opportunity), the main agent calls a dedicated Airtable CRM sub-workflow* to handle the task. Modular Calendar Agent (Sub-Workflow):* To book appointments, the main agent calls a separate Google Calendar sub-workflow*, which manages event creation, updates, and deletions. What You'll Need This workflow framework requires credentials for the following services: An AI provider (OpenAI is used for the main agent, transcription, and embeddings). PostgreSQL** database with the pgvector extension (for RAG and chat memory). Airtable** account (for the CRM sub-workflow). Google Calendar** account (for the Calendar sub-workflow). Telegram Bot** credentials. A Meta Developer Account (for WhatsApp, Instagram & Facebook). (Optional) Google Drive for loading knowledge documents. (Optional) Google Gemini for embeddings. How to Set It Up This is a modular system. You must set up the sub-workflows first. Deploy Sub-Workflows: Create two new, separate workflows using the provided templates for the CRM Agent and the Calendar Agent. Configure the credentials (Airtable, Google Calendar) within those workflows, then save and activate them. Link Sub-Workflows in Main Workflow: Return to this main workflow. In the "CRM Agent" and "Consultation Agent" tool nodes, select the new workflows you just created from the dropdown list. Configure Main Credentials: Securely add the remaining credentials (OpenAI, PostgreSQL, Telegram, and your Meta App) in this main workflow. Personalize the AI Agent: In the "Update Agent Details" node, fill in your business name, the agent's persona name, and your key services to customize the AI's personality. Load Your Knowledge (Optional): To populate the RAG database, use the manual trigger path starting with "When clicking ‘Execute workflow’" to download a document from Google Drive and insert it into your PostgreSQL vector store. Activate: Configure your channel-specific details (e.g., Phone Number ID in WhatsApp nodes), save the workflow, and activate it. Demo CRM Table: View on Airtable

Automate social fan-out, marketplace outreach, and CRM alerts with Salesforce

⚠️ Heads up: this is satire. The "Hell Yeah!" workflow is a parody of "automate your whole life with AI agents" grindset content. The API endpoints are fictional and the function nodes are illustrative stubs. It's published as a template because the patterns underneath the joke — multi-channel social fan-out, marketplace scraping with follow-up sequences, CRM sync with chat alerts, cron-triggered daily chains — are genuinely useful starting points for n8n agencies building real lead-gen flows. Swap the jokes for your actual integrations and you've got a working skeleton. How it works A Rise and Grind cron kicks off a parallel "daily lifestyle" routine every morning A gambling → flex chain runs arbitrage math against a fake sportsbook and fans the "wins" out to Instagram, TikTok, Facebook, Threads, LinkedIn, and Twitter in one blast (this is the reusable multi-channel social posting pattern) A Facebook Marketplace lowball engine scrapes listings, filters them, fires templated lowball offers, and runs a relentless follow-up sequence (reusable pattern: scraper → filter → outreach → nurture) An eBay arbitrage loop finds profitable items, relists them, and logs every transaction to Google Sheets A Salesforce + Telegram branch handles "deal alerts" — the standard CRM-sync-with-chat-notification pattern every agency ships Extra satirical branches (Tinder auto-booking, Uber Black to the casino, steak delivery, playing Alice in Chains) are there for the bit — delete or replace them Set up steps Takes about 15–20 minutes if you're just importing to read through the patterns Takes 1–2 hours if you're stripping out the satirical branches and wiring the reusable patterns (social fan-out, marketplace outreach, CRM+Telegram) to your real credentials Replace every fictional HTTP endpoint with your actual API before activating Add credentials for whichever real nodes you keep: Salesforce, Telegram, Google Sheets, WhatsApp, Facebook Graph Detailed notes for each section live in the sticky notes inside the workflow itself

Build your own Facebook Graph API and WhatsApp Business Cloud integration

Create custom Facebook Graph API 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.

WhatsApp Business Cloud supported actions

Send
Send and Wait for Response
Send Template
Upload
Download
Delete

Facebook Graph API and WhatsApp Business Cloud integration details

integrationFacebook Graph API node
Facebook Graph API

Facebook needs no introduction. It is an online social networking and media service that gathers people from all parts of the world, from different backgrounds, and allows them to promote their businesses and services, share, react to and comment on all types of content, and communicate and message their friends.

Use case

Save engineering resources

Reduce time spent on customer integrations, engineer faster POCs, keep your customer-specific functionality separate from product all without having to code.

Learn more

FAQs

  • Can Facebook Graph API connect with WhatsApp Business Cloud?

  • Can I use Facebook Graph API’s API with n8n?

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

  • Is n8n secure for integrating Facebook Graph API and WhatsApp Business Cloud?

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

Looking to integrate Facebook Graph API and WhatsApp Business Cloud in your company?

Over 3000 companies switch to n8n every single week

Why use n8n to integrate Facebook Graph API 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