Skip to main content

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

Workflow preview

Workflow preview
100%
Capture and enrich leads with GPT-4o, Postgres, Slack, Gmail and your CRM preview
Open on n8n.io

1. Workflow Overview

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 t...

Best for

  • Lead Generation automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.set, n8n-nodes-base.if, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.postgres, n8n-nodes-base.code

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by ResilNext.

Original n8n.io source

1.1 Workflow description

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

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

  1. Webhook Trigger
  • Captures lead data from forms or landing pages.
  1. Workflow Configuration
  • Defines:
  • CRM API endpoint
  • Slack notification channel
  • Sales reps list for assignment
  1. Validation
  • Ensures required fields (name and email) are present.
  • Routes invalid submissions to error handling.
  1. Data Normalization
  • Structures lead data (name, email, phone, company, message).
  1. AI Lead Enrichment
  • Classifies lead as:
  • Hot
  • Warm
  • Cold
  • Generates:
  • Score reasoning
  • Estimated deal value
  • Company insights
  • Recommended next actions
  1. Database Storage
  • Stores enriched lead data in Postgres.
  1. Sales Assignment
  • Assigns leads using round-robin distribution logic.
  1. CRM Integration
  • Sends lead data to CRM (e.g., HubSpot, GoHighLevel)
  • Optionally creates Salesforce leads
  1. Automated Communication
  • Sends welcome email to the lead
  • Notifies sales team via Slack
  1. Activity Logging
  • Logs all actions for tracking and analytics

Setup Instructions

  1. Webhook Setup
  • Configure endpoint (lead-capture)
  • Connect your form or frontend
  1. OpenAI Credentials
  • Add API key for lead scoring and enrichment
  1. Database Setup
  • Configure Postgres credentials
  • Create tables:
  • leads
  • activity_log
  1. CRM Integration
  • Add API credentials for your CRM
  • Set endpoint URL
  1. Salesforce (Optional)
  • Configure Salesforce credentials if used
  1. Slack Integration
  • Add Slack credentials
  • Set channel ID for notifications
  1. Email Setup
  • Connect Gmail account for sending emails
  1. 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.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Lead Form Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 2 - Workflow Configuration

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Validate Required Fields

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 4 - Normalize Lead Data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 5 - AI Lead Enrichment & Scoring

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3

Block 6 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.3

Block 7 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 8 - Store Lead in Database

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 9 - Round-Robin Sales Assignment

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Send to CRM

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.3

Block 11 - Send Welcome Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.2

Block 12 - Notify Sales Team

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.4

Block 13 - Log Activity

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 14 - Handle Validation Error

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 15 - Create Salesforce Lead

Type / Role
n8n-nodes-base.salesforce - salesforce
Config choices
Version 1

Block 16 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Sticky Note10

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 25 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Capture and enrich leads with GPT-4o, Postgres, Slack, Gmail and your CRM
Complexity advanced
Nodes 25
Categories Lead Generation, AI Summarization
Author ResilNext
Published 03 Apr 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/14687/14687.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Capture and enrich leads with GPT-4o, Postgres, Slack, Gmail and your CRM do?

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 t...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Lead Generation, AI Summarization use case.