Capture and enrich leads with GPT-4o, Postgres, Slack, Gmail and your CRM

Go to Workflow
0 views
Built by ResilNext ResilNext
Created on June 05, 2026

Description


Overview
This workflow captures incoming leads from a webhook, enriches them using AI, and automates the entire sales pipeline. It validates data, scores leads as hot, warm, or cold, assigns them to sales reps, syncs with CRM systems, and triggers notifications and follow-ups.

It helps teams respond faster, prioritize high-value leads, and streamline sales operations with minimal manual effort.

How It Works

Webhook Trigger
Captures lead data from forms or landing pages.

Workflow Configuration
Defines:
CRM API endpoint
Slack notification channel
Sales reps list for assignment

Validation
Ensures required fields (name and email) are present.
Routes invalid submissions to error handling.

Data Normalization
Structures lead data (name, email, phone, company, message).

AI Lead Enrichment
Classifies lead as:
Hot
Warm
Cold
Generates:
Score reasoning
Estimated deal value
Company insights
Recommended next actions

Database Storage
Stores enriched lead data in Postgres.

Sales Assignment
Assigns leads using round-robin distribution logic.

CRM Integration
Sends lead data to CRM (e.g., HubSpot, GoHighLevel)
Optionally creates Salesforce leads

Automated Communication
Sends welcome email to the lead
Notifies sales team via Slack

Activity Logging
Logs all actions for tracking and analytics

Setup Instructions

Webhook Setup
Configure endpoint (lead-capture)
Connect your form or frontend

OpenAI Credentials
Add API key for lead scoring and enrichment

Database Setup
Configure Postgres credentials
Create tables:
leads
activity_log

CRM Integration
Add API credentials for your CRM
Set endpoint URL

Salesforce (Optional)
Configure Salesforce credentials if used

Slack Integration
Add Slack credentials
Set channel ID for notifications

Email Setup
Connect Gmail account for sending emails

Configure Sales Reps
Add email list in configuration node

Use Cases

Automated lead qualification for marketing teams
SaaS lead management pipelines
Agency client acquisition workflows
CRM automation with AI enrichment
Sales team lead distribution systems

Requirements

OpenAI API key
Postgres database
CRM system (HubSpot, GoHighLevel, or similar)
Gmail account
Slack workspace
Salesforce account (optional)
n8n instance

Key Features

AI-powered lead scoring and enrichment
Automated validation and error handling
Round-robin sales assignment
Multi-CRM integration support
Real-time Slack notifications
Automated email follow-ups
Full activity tracking and logging

Summary

A complete AI-driven lead management system that captures, enriches, scores, and routes leads automatically. It enables faster response times, better lead prioritization, and scalable sales automation for modern teams.

Nodes Used (9)

AI Agent
@n8n/n8n-nodes-langchain.agent
Code
n8n-nodes-base.code
Gmail
n8n-nodes-base.gmail
HTTP Request
n8n-nodes-base.httpRequest
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Postgres
n8n-nodes-base.postgres
Salesforce
n8n-nodes-base.salesforce
Slack
n8n-nodes-base.slack
Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured