💬 Reply to WhatsApp sales leads with OpenAI, Supabase, and Slack alerts

⚡ 3 views · 💬 Lead Nurturing & AI Sales Agents

Description

Quick overview

This workflow receives WhatsApp Cloud API messages, uses OpenAI to generate grounded sales replies, logs and scores each lead in Supabase, and notifies your team in Slack when a lead is hot or needs a human.

How it works

  1. Receives WhatsApp Cloud API webhook calls for inbound messages and handles Meta’s one-time webhook verification challenge.
  2. Normalizes the incoming WhatsApp payload into a clean customer message record and ignores non-message status callbacks.
  3. Checks Supabase to deduplicate by WhatsApp message ID, then looks up (or creates) the customer record by phone number and pulls recent conversation history.
  4. Loads the product catalog from Supabase and sends the customer message, recent history, and business info to an OpenAI-backed agent to classify intent and draft a short reply.
  5. Applies rule-based lead scoring to label the conversation Cold/Warm/Hot and prepares the final response payload.
  6. Sends the AI reply back to the customer on WhatsApp, saves the conversation in Supabase, updates the customer CRM fields, and posts a Slack alert when the lead is Hot or the agent flags that a human is needed.

Setup

  1. Configure Meta WhatsApp Cloud API to call the workflow’s webhook URL and set the same verify token in Meta and in the webhook verification response logic.
  2. Add credentials for Supabase, OpenAI, and Slack, and ensure the Slack OAuth connection can post to your chosen channel.
  3. Create Supabase tables for customers, conversations, and products (including fields used for phone, message_id, timestamps, product_name, and any stored prices), then populate products with your catalog.
  4. Update the client-specific values in the business configuration (business name, WhatsApp phone number ID, Slack channel ID, and delivery/payment/returns/hours/contact details).

Requirements

Customization

🔗 Nodes Used

Slack, Webhook, Supabase, WhatsApp Business Cloud, AI Agent, OpenAI Chat Model

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup