OpenAI + Supabase, enriched leads you can trust
Your lead list looks “fine” until you actually try to use it. Missing job titles. Vague company fields. Notes that say “met at conference” and nothing else. Lead enrichment automation fixes that gap before it turns into bad routing and awkward outreach.
Marketing Ops gets stuck cleaning spreadsheets instead of building campaigns. Sales reps lose time researching basics before they can write a decent first email. And founders doing their own outbound feel it too, because every mistake is personal (and visible).
This workflow takes the contact data you already have, asks OpenAI to fill what’s missing and generate buyer insights, then logs both the input and the AI output into Supabase so you can trust what happened later. You will see how it works, what you need, and where teams usually trip up.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: OpenAI + Supabase, enriched leads you can trust
flowchart LR
subgraph sg0["Flow 1"]
direction LR
n0["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/webhook.dark.svg' width='40' height='40' /></div><br/>Incoming Webhook Start"]
n1["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Transform Input Payload"]
n2["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Compose AI Prompt"]
n3["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>External AI Request"]
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/supabase.svg' width='40' height='40' /></div><br/>Persist to Supabase"]
n5["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Shape Output Reply"]
n3 --> n4
n1 --> n2
n0 --> n1
n4 --> n5
n2 --> n3
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0,n3 api
class n1,n2,n5 code
classDef customIcon fill:none,stroke:none
class n0,n1,n2,n3,n4,n5 customIcon
The Problem: Incomplete leads create messy outreach
Most “lead problems” aren’t volume problems. They’re quality problems. You import contacts from forms, events, list pulls, referrals, or a CRM export, and half the fields are blank or inconsistent. One contact has “VP Marketing,” another has “Marketing Lead,” another has nothing. Then you try to segment, score, or route leads and it turns into guesswork. People patch the data manually, which is slow, and honestly it still leaves you with questionable profiles.
It adds up fast. Here’s where it breaks down in real life.
- Reps spend about 10 minutes per lead researching basics before sending anything.
- Bad titles and missing roles cause misrouted leads, so the wrong person follows up (or nobody does).
- Personalization variables end up empty, which makes campaigns look sloppy and “spray-and-pray.”
- You can’t audit what changed later, because the enrichment happened in someone’s browser tabs.
The Solution: AI enrichment with Supabase logging
This n8n workflow gives you a clean, repeatable way to enrich contact records as they arrive. It starts with a webhook that receives basic lead info (email or name at minimum, plus whatever else you have like company, LinkedIn URL, website, notes). n8n standardizes that payload, adds a unique ID and timestamp, then composes an AI request that tells OpenAI what to infer and how to respond (structured JSON). After the AI returns enrichment data, the workflow writes the original input and the AI output into Supabase, creating an audit trail you can query later. Finally, it replies with a simple success response so the system that sent the lead knows it worked.
The flow is simple: a webhook receives a lead, OpenAI generates missing details and buyer insights, and Supabase stores both sides of the exchange. That storage piece is the difference between “AI guessed something” and “we can prove what happened and improve it.”
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you add 30 new leads a week from a form and a list upload. If a rep spends about 10 minutes per lead to find a likely title, seniority, pain points, and a few personalization ideas, that’s about 5 hours weekly. With this workflow, you push each lead into the webhook in under a minute, wait roughly a minute for the AI response, and it’s logged in Supabase automatically. You get those hours back, and the data is consistent across the whole team.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- OpenAI to generate enrichment and persona JSON
- Supabase for audit logging and querying results
- OpenAI API key (get it from the OpenAI dashboard)
Skill level: Intermediate. You will connect credentials, set a few environment variables, and test a webhook payload.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A webhook receives a new lead. Your form, CRM, or internal tool sends JSON with an email or name (and ideally company plus LinkedIn URL). That single endpoint becomes your “front door” for enrichment.
The incoming data gets cleaned and packaged. n8n standardizes field names, adds a unique ID and timestamp, then prepares a structured prompt that asks for missing details, company context, and buyer insights in JSON format.
OpenAI enriches the contact. The workflow calls the OpenAI Chat model through an HTTP request, using environment variables for provider, model, and API key. If you later switch providers, you update the config once instead of rebuilding the whole flow.
Supabase stores an audit record and n8n replies. The workflow writes both the original payload and the AI response into a Supabase table (so you can review, query, and export). Then it returns a short “success” response to the system that sent the lead.
You can easily modify the enrichment prompt to match your ICP and tone based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Webhook Trigger
This workflow starts when an external system calls your webhook endpoint.
- Add and open Incoming Webhook Start.
- Copy the webhook URL generated by Incoming Webhook Start and use it in your source system.
- Connect Incoming Webhook Start to Transform Input Payload to match the execution flow.
Step 2: Connect Supabase
Data from the AI enrichment is stored in Supabase.
- Add and open Persist to Supabase.
- Configure the destination table and fields to match your enrichment output.
- Ensure External AI Request connects to Persist to Supabase to preserve the execution flow.
Step 3: Set Up Processing and AI Preparation
These nodes normalize the incoming data and build the AI prompt.
- Open Transform Input Payload and add your input parsing logic.
- Open Compose AI Prompt and construct the prompt structure needed for enrichment.
- Confirm the sequence Transform Input Payload → Compose AI Prompt → External AI Request.
Step 4: Configure the External AI Call and Output Response
Send the prompt to your AI provider, then format the final response back to the webhook caller.
- Open External AI Request and configure the HTTP request details required by your AI service.
- Map the prompt from Compose AI Prompt into the request body.
- Open Shape Output Reply and format the response returned to the webhook caller.
- Confirm the sequence Persist to Supabase → Shape Output Reply to ensure the response includes stored enrichment data.
Step 5: Test and Activate Your Workflow
Validate the full execution chain from the webhook to storage and response.
- Click Execute Workflow and send a test payload to Incoming Webhook Start.
- Verify the data passes through Transform Input Payload, Compose AI Prompt, and External AI Request without errors.
- Confirm the enrichment record is created by Persist to Supabase and the output is formatted by Shape Output Reply.
- Toggle the workflow to Active for production use.
Common Gotchas
- Supabase credentials can expire or need specific permissions. If things break, check your Supabase Project Settings → API keys and the n8n credential named “Supabase API” first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Frequently Asked Questions
About 30 minutes if your OpenAI and Supabase accounts are ready.
No. You will paste credentials, set environment variables, and test a webhook payload.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API usage, which is usually small per contact but depends on your model and prompt size.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and you should. Update the prompt in the “Compose AI Prompt” code node so it reflects your ICP, what “qualified” means, and the exact JSON fields you want back (like seniority, department, pain points, and a 1–10 lead score). If you prefer a different model, change the environment variables used to build the AI request. Many teams also add a simple validation rule after the AI response to reject outputs that contradict known fields.
Usually it’s the Supabase URL or API key in the n8n credential, or the key doesn’t have permission to insert into your logging table. Double-check the credential named “Supabase API,” then confirm the table exists and your project key is the right one for server-side inserts. If you rotated keys recently, you need to update n8n too.
On self-hosted n8n there’s no hard execution limit, so it mostly depends on your server and OpenAI rate limits.
Often, yes, because this kind of enrichment benefits from flexible logic, structured JSON handling, and reliable logging. n8n makes it easier to store the full input and output as JSON, then branch based on conditions (like “only enrich if job_title is missing” or “skip suppressed domains”). It also gives you a self-hosting path when volume grows, which can matter a lot for list enrichment. Zapier or Make can be quicker for a basic two-step flow, but you may hit limits once you add validation, batching, and an audit trail. If you want a second opinion, Talk to an automation expert.
Once this is running, every lead arrives with context and a paper trail. The workflow handles the repetitive cleanup so your outreach can start strong.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.