Skip to main content

Generate personalized sales leads with Claude AI & Explorium for Gmail outreach

Workflow preview

Workflow preview
100%
Generate personalized sales leads with Claude AI & Explorium for Gmail outreach preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Outbound Agent AI Powered Lead Generation with Natural Language Prospecting This n8n workflow transforms natural language queries into targeted B2B prospecting campaigns by combining Explorium's da...

Best for

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

Tools used

n8n-nodes-base.code, n8n-nodes-base.if, @n8n/n8n-nodes-langchain.memorybufferwindow, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.outputparserstructured, @exploriumai/n8n-nodes-explorium-ai.exploriumapinode, @n8n/n8n-nodes-langchain.lmchatanthropic, @n8n/n8n-nodes-langchain.chattrigger

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Generate personalized sales leads with Claude AI & Explorium for Gmail outreach
Workflow name
Generate personalized sales leads with Claude AI & Explorium for Gmail outreach

Outbound Agent - AI-Powered Lead Generation with Natural Language Prospecting

This n8n workflow transforms natural language queries into targeted B2B prospecting campaigns by combining Explorium's data intelligence with AI-powered research and personalized email generation. Simply describe your ideal customer profile in plain English, and the workflow automatically finds prospects, enriches their data, researches them, and creates personalized email drafts.

DEMO

Template Demo

Credentials Required

To use this workflow, set up the following credentials in your n8n environment:

Anthropic API

  • Type: API Key
  • Used for: AI Agent query interpretation, email research, and email writing
  • Get your API key at Anthropic Console

Explorium API

  • Type: Generic Header Auth
  • Header: Authorization
  • Value: Bearer YOUR_API_KEY
  • Used for: Prospect matching, contact enrichment, professional profiles, and MCP research
  • Get your API key at Explorium Dashboard

Explorium MCP

  • Type: HTTP Header Auth
  • Used for: Real-time company and prospect intelligence research
  • Connect to: https://mcp.explorium.ai/mcp

Gmail

  • Type: OAuth2
  • Used for: Creating email drafts
  • Alternative options: Outlook, Mailchimp, SendGrid, Lemlist

Go to Settings → Credentials, create these credentials, and assign them in the respective nodes before running the workflow.


Workflow Overview

Node 1: When chat message received

This node creates an interactive chat interface where users can describe their prospecting criteria in natural language.

  • Type: Chat Trigger
  • Purpose: Accept natural language queries like "Get 5 marketing leaders at fintech startups who joined in the past year and have valid contact information"
  • Example Prompts:
    • "Find SaaS executives in New York with 50-200 employees"
    • "Get marketing directors at healthcare companies"
    • "Show me VPs at fintech startups with recent funding"

Node 2: Chat or Refinement

This code node manages the conversation flow, handling both initial user queries and validation error feedback.

  • Function: Routes either the original chat input or validation error messages to the AI Agent
  • Dynamic Input: Combines chatInput and errorInput fields
  • Purpose: Creates a feedback loop for validation error correction

Node 3: AI Agent

The core intelligence node that interprets natural language and generates structured API calls.

Functionality:

  • Interprets user intent from natural language queries
  • Maps concepts to Explorium API filters (job levels, departments, company size, revenue, location, etc.)
  • Generates valid JSON requests with precise filter criteria
  • Handles off-topic queries with helpful guidance
  • Connected to MCP Client for real-time filter specifications

AI Components:

  • Anthropic Chat Model: Claude Sonnet 4 for query interpretation
  • Simple Memory: Maintains conversation context (100 message window)
  • Output Parser: Structured JSON output with schema validation
  • MCP Client: Connected to https://mcp.explorium.ai/mcp for Explorium specifications

System Instructions:

  • Expert in converting natural language to Explorium API filters
  • Can revise previous responses based on validation errors
  • Strict adherence to allowed filter values and formats
  • Default settings: mode: "full", size: 10000, page_size: 100, has_email: true

Node 4: API Call Validation

This code node validates the AI-generated API request against Explorium's filter specifications.

Validation Checks:

  • Filter key validity (only allowed filters from approved list)
  • Value format correctness (enums, ranges, country codes)
  • No duplicate values in arrays
  • Proper range structure for experience fields (total_experience_months, current_role_months)
  • Required field presence

Allowed Filters:

  • country_code, region_country_code, company_country_code, company_region_country_code
  • company_size, company_revenue, company_age, number_of_locations
  • google_category, naics_category, linkedin_category, company_name
  • city_region_country, website_keywords
  • has_email, has_phone_number
  • job_level, job_department, job_title
  • business_id, total_experience_months, current_role_months

Output:

  • isValid: Boolean validation status
  • validationErrors: Array of specific error messages

Node 5: Is API Call Valid?

Conditional routing node that determines the next step based on validation results.

  • If Valid: Proceed to Explorium API: Fetch Prospects
  • If Invalid: Route to Validation Prompter for correction

Node 6: Validation Prompter

Generates detailed error feedback for the AI Agent when validation fails. This creates a self-correcting loop where the AI learns from validation errors and regenerates compliant requests by routing back to Node 2 (Chat or Refinement).

Node 7: Explorium API: Fetch Prospects

Makes the validated API call to Explorium's prospect database.

  • Method: POST
  • Endpoint: /v1/prospects/fetch
  • Authentication: Header Auth (Bearer token)
  • Input: JSON with filters, mode, size, page_size, page
  • Returns: Array of matched prospects with prospect IDs based on filter criteria

Node 8: Pull Prospect IDs

Extracts prospect IDs from the fetch response for bulk enrichment.

  • Input: Full fetch response with prospect data
  • Output: Array of prospect_id values formatted for enrichment API

Node 9: Explorium API: Contact Enrichment

Single enrichment node that enhances prospect data with both contact and profile information.

  • Method: POST
  • Endpoint: /v1/prospects/enrich
  • Enrichment Types: contacts, profiles
  • Authentication: Header Auth (Bearer token)
  • Input: Array of prospect IDs from Node 8

Returns:

  • Contacts: Professional emails (current, verified), phone numbers (mobile, work), email validation status, all available email addresses
  • Profiles: Full professional history, current role details, company information, skills and expertise, education background, experience timeline, job titles and seniority levels

Node 10: Clean Output Data

Transforms and structures the enriched data for downstream processing.

Node 11: Loop Over Items

Iterates through each prospect to generate individualized research and emails.

  • Batch Size: 1 (processes prospects one at a time)
  • Purpose: Enable personalized research and email generation for each prospect
  • Loop Control: Processes until all prospects are complete

Node 12: Research Email

AI-powered research agent that investigates each prospect using Explorium MCP.

Input Data:

  • Prospect name, job title, company name, company website
  • LinkedIn URL, job department, skills

Research Focus:

  • Company automation tool usage (n8n, Zapier, Make, HubSpot, Salesforce)
  • Data enrichment practices
  • Tech stack and infrastructure (Snowflake, Segment, etc.)
  • Recent company activity and initiatives
  • Pain points related to B2B data (outdated CRM data, manual enrichment, static workflows)
  • Public content (speaking engagements, blog posts, thought leadership)

AI Components:

  • Anthropic Chat Model1: Claude Sonnet 4 for research
  • Simple Memory1: Maintains research context
  • Explorium MCP1: Connected to https://mcp.explorium.ai/mcp for real-time intelligence

Output: Structured JSON with research findings including automation tools, pain points, personalization notes

Node 13: Email Writer

Generates personalized cold email drafts based on research findings.

Input Data:

  • Contact info from Loop Over Items
  • Current experience and skills
  • Research findings from Research Email agent
  • Company data (name, website)

AI Components:

  • Anthropic Chat Model3: Claude Sonnet 4 for email writing
  • Structured Output Parser: Enforces JSON schema with email, subject, message fields

Output Schema:

  • email: Selected prospect email address (professional preferred)
  • subject: Compelling, personalized subject line
  • message: HTML formatted email body

Node 14: Create a draft (Gmail)

Creates email drafts in Gmail for review before sending.

  • Resource: Draft
  • Subject: From Email Writer output
  • Message: HTML formatted email body
  • Send To: Selected prospect email address
  • Authentication: Gmail OAuth2

After Creation: Loops back to Node 11 (Loop Over Items) to process next prospect

Alternative Output Options:

  • Outlook: Create drafts in Microsoft Outlook
  • Mailchimp: Add to email campaign
  • SendGrid: Queue for sending
  • Lemlist: Add to cold email sequence

Workflow Flow Summary

  1. Input: User describes target prospects in natural language via chat interface
  2. Interpret: AI Agent converts query to structured Explorium API filters using MCP
  3. Validate: API call validation ensures filter compliance
  4. Refine: If invalid, error feedback loop helps AI correct the request
  5. Fetch: Retrieve matching prospect IDs from Explorium database
  6. Enrich: Parallel bulk enrichment of contact details and professional profiles
  7. Clean: Transform and structure enriched data
  8. Loop: Process each prospect individually
  9. Research: AI agent uses Explorium MCP to gather company and prospect intelligence
  10. Write: Generate personalized email based on research
  11. Draft: Create reviewable email drafts in preferred platform

This workflow eliminates manual prospecting work by combining natural language processing, intelligent data enrichment, automated research, and personalized email generation—taking you from "I need marketing leaders at fintech companies" to personalized, research-backed email drafts in minutes.


Customization Options

Flexible Triggers

The chat interface can be replaced with:

  • Scheduled runs for recurring prospecting
  • Webhook triggers from CRM updates
  • Manual execution for ad-hoc campaigns

Scalable Enrichment

Adjust enrichment depth by:

  • Adding more Explorium API endpoints (technographics, funding, news)
  • Configuring prospect batch sizes
  • Customizing data cleaning logic

Output Destinations

Route emails to your preferred platform:

  • Email Platforms: Gmail, Outlook, SendGrid, Mailchimp
  • Sales Tools: Lemlist, Outreach, SalesLoft
  • CRM Integration: Salesforce, HubSpot (create leads with research)
  • Collaboration: Slack notifications, Google Docs reports

AI Model Flexibility

Swap AI providers based on your needs:

  • Default: Anthropic Claude (Sonnet 4)
  • Alternatives: OpenAI GPT-4, Google Gemini

Setup Notes

  1. Domain Filtering: The workflow prioritizes professional emails—customize email selection logic in the Clean Output Data node
  2. MCP Configuration: Explorium MCP requires Header Auth setup—ensure credentials are properly configured
  3. Rate Limits: Adjust Loop Over Items batch size if hitting API rate limits
  4. Memory Context: Simple Memory maintains conversation history—increase window length for longer sessions
  5. Validation: The AI self-corrects through validation loops—monitor early runs to ensure filter accuracy

This workflow represents a complete AI-powered sales development representative (SDR) that handles prospecting, research, and personalized outreach with minimal human intervention.

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 - API Call Validation

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

Block 2 - Validation Prompter

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

Block 3 - Is API Call Valid?

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

Block 4 - Chat or Refinement

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

Block 5 - Simple Memory

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

Block 6 - AI Agent

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

Block 7 - Output Parser

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

Block 8 - Explorium API: Fetch Prospects

Type / Role
@exploriumai/n8n-nodes-explorium-ai.exploriumApiNode - exploriumApiNode
Config choices
Version 1

Block 9 - Simple Memory1

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

Block 10 - Anthropic Chat Model3

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

Block 11 - Pull Prospect IDs

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

Block 12 - Clean Output Data

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

Block 13 - Research Email

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

Block 14 - Email Writer

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

Block 15 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.1

Block 16 - Create a draft

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

Block 17 - Explorium API: Contact Enrichment

Type / Role
@exploriumai/n8n-nodes-explorium-ai.exploriumApiNode - exploriumApiNode
Config choices
Version 1

Block 18 - Sticky Note15

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

Block 19 - Sticky Note16

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

Block 20 - Sticky Note

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

Block 21 - Sticky Note1

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

Block 22 - Anthropic Chat Model2

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

Block 23 - Loop Over Items3

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 24 - Anthropic Chat Model4

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

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

3. Summary Table

Workflow Generate personalized sales leads with Claude AI & Explorium for Gmail outreach
Complexity advanced
Nodes 30
Categories Lead Generation, AI Chatbot
Author explorium
Published 06 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10561/10561.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 Generate personalized sales leads with Claude AI & Explorium for Gmail outreach do?

Outbound Agent AI Powered Lead Generation with Natural Language Prospecting This n8n workflow transforms natural language queries into targeted B2B prospecting campaigns by combining Explorium's da...

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 Chatbot use case.