Quick overview
Turn every Facebook ad lead into a qualified, followed-up prospect within seconds. AI scores their intent, sends a personalized email tailored to their score, logs campaign intelligence to Google Sheets, and alerts you instantly to hot leads before they consider a competitor.
How it works
- Receives a lead submission via an n8n webhook (or the disabled Facebook Lead Ads trigger).
- Extracts and normalizes contact details, qualification answers, and Facebook campaign metadata into a consistent lead record.
- Sends the lead details to Google Gemini to classify the lead as Hot/Warm/Cold and generate a personalized follow-up email.
- Parses and formats the AI output, falling back to a default email draft if the response cannot be parsed.
- If an email address is present, sends the AI-written follow-up email to the lead using Gmail.
- Appends the lead, AI score, reasoning, and campaign fields to a Google Sheets log.
- If the lead is scored Hot, notifies the agent via Gmail and Slack, then updates the Google Sheets row to mark the agent as notified.
Setup
- Credentials needed: Add credentials for Google Gemini (PaLM/Gemini API), Gmail OAuth2, Google Sheets OAuth2, Slack OAuth2 (optional), and WhatsApp Business Cloud API + Phone Number ID (optional).
- Google Sheet setup: Copy the Facebook Leads Database sheet template and link its ID to both the Append and Update Sheets nodes. The sheet requires these columns in order: recordId, Timestamp, Lead Name, Email, Phone, Intent, Budget, Timeline, Situation, Lead Score, Score Reasoning, Email Subject, Agent Notified, Facebook Lead ID, Form ID, Ad ID, Campaign ID.
- Facebook Lead Ad form setup: Create a Facebook Lead Ad form with these fields: Full Name (pre-filled), Email Address (pre-filled), Phone Number (pre-filled), and four custom short-answer questions covering intent, budget, timeline, and situation. After creating the form, fire one test lead via the Meta Lead Ads Testing Tool and inspect the raw webhook payload in n8n to confirm the exact field names Facebook generates — update the Extract node field mappings to match.
- Replace the placeholder agent email address in the hot-lead Gmail notification and set the Slack channel (optional) plus Slack credentials.
- If using the webhook trigger, copy the webhook URL into your lead source (e.g., Zapier/Make/Facebook forwarding) and send a test payload that matches your Facebook form field names.
- If using WhatsApp (optional), add a WhatsApp Business Cloud credential and replace YOUR_PHONE_NUMBER_ID with your Meta phone number ID.
- If using Slack, set the correct channel name in the Notify Agent via Slack node and confirm your Slack bot has been invited to that channel.
- Choose your trigger: The Webhook trigger is active by default and works immediately. To use the Facebook Lead Ads trigger directly, enable that node, disable the Webhook node, and configure your Meta Developer app with a permanent public n8n URL.
Customization
- Edit the AI scoring rules in the Qualify & Draft Follow-Up node to adjust what qualifies as Hot, Warm, or Cold for your market.
- Edit the email tone per score tier in the system prompt — change language, formality, or translate to another language.
- Add more qualification fields by extending your Facebook form and mapping the new field names in the Extract & Normalize Lead Details Code node.
- Enable the Facebook Lead Ads trigger (Option B) for direct integration without a webhook forwarder, which requires a permanent public n8n URL and Meta Developer app configuration.
- Add Warm lead agent notifications by duplicating the Hot lead notification branch and changing the IF condition to check for Warm score.
- Extend the Google Sheet with additional columns (e.g., follow-up date, assigned agent) without affecting the workflow logic.