AutomationFlowsMarketing & Ads › Lead Enrichment Microservice (clay)

Lead Enrichment Microservice (clay)

Lead Enrichment Microservice (Clay). Uses httpRequest. Webhook trigger; 5 nodes.

Webhook trigger★★★★☆ complexity5 nodesHTTP Request
Marketing & Ads Trigger: Webhook Nodes: 5 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "Lead Enrichment Microservice (Clay)",
  "nodes": [
    {
      "id": "webhook-1",
      "name": "Lead Enrichment Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        250,
        300
      ],
      "parameters": {
        "path": "lead-enrichment",
        "httpMethod": "POST",
        "responseMode": "responseNode",
        "authentication": "headerAuth",
        "options": {}
      }
    },
    {
      "id": "extract-domain",
      "name": "Extract Domain",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        450,
        300
      ],
      "parameters": {
        "jsCode": "const lead = $input.item.json;\nconst email = lead.email || lead.company_url || '';\nlet domain = '';\n\nif (email.includes('@')) {\n  domain = email.split('@')[1];\n} else if (email.startsWith('http')) {\n  try {\n    domain = new URL(email).hostname.replace('www.', '');\n  } catch (e) {\n    domain = email;\n  }\n} else {\n  domain = email;\n}\n\nconst freeProviders = ['gmail.com', 'yahoo.com', 'hotmail.com', 'outlook.com', 'icloud.com'];\nconst isBusinessEmail = domain && !freeProviders.includes(domain.toLowerCase());\n\nreturn { \n  ...lead, \n  extracted_domain: domain,\n  is_business: isBusinessEmail\n};"
      }
    },
    {
      "id": "clay-enrich",
      "name": "Clay AI Enrichment",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [
        650,
        300
      ],
      "parameters": {
        "method": "POST",
        "url": "https://api.clay.com/v3/search",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer {{ $env.CLAY_API_KEY }}"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "domain",
              "value": "={{ $json.extracted_domain }}"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "format-response",
      "name": "Format Response",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        850,
        300
      ],
      "parameters": {
        "jsCode": "const lead = $(\"Extract Domain\").item.json;\nconst clayData = $input.item.json;\n\n// Clay usually returns deep enriched data including company info, description, and AI insights if configured\nreturn {\n  ...lead,\n  company_name: clayData.company?.name || lead.company_name || lead.businessName,\n  company_domain: clayData.company?.domain || lead.extracted_domain,\n  company_logo: clayData.company?.logoUrl || null,\n  ai_research: clayData.ai_summary || clayData.company?.description || 'Enriched via Clay AI',\n  enrichment_source: 'clay_official',\n  enriched_at: new Date().toISOString(),\n  status: 'enriched'\n};"
      }
    },
    {
      "id": "respond-node",
      "name": "Return Enriched Data",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        1050,
        300
      ],
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ $json }}",
        "options": {
          "responseCode": 200
        }
      }
    }
  ],
  "connections": {
    "Lead Enrichment Webhook": {
      "main": [
        [
          {
            "node": "Extract Domain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Domain": {
      "main": [
        [
          {
            "node": "Clay AI Enrichment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clay AI Enrichment": {
      "main": [
        [
          {
            "node": "Format Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Response": {
      "main": [
        [
          {
            "node": "Return Enriched Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Lead Enrichment Microservice (Clay). Uses httpRequest. Webhook trigger; 5 nodes.

Source: https://github.com/wranngle/n8n_showcase/blob/main/workflows/lead-enrichment-microservice.json — original creator credit. Request a take-down →

More Marketing & Ads workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Marketing & Ads

This workflow automates bulk email campaigns with built-in validation, deliverability protection, and smart send-time optimization.

HTTP Request, Postgres, Gmail
Marketing & Ads

Universal Lead Processing Workflow. Uses googleSheets, gmail, httpRequest, gmailTrigger. Webhook trigger; 34 nodes.

Google Sheets, Gmail, HTTP Request +1
Marketing & Ads

This workflow turns Feishu bot messages into a human-in-the-loop short-video production pipeline, using Tavily for web search, DeepSeek for topic and script generation, Jimeng AI for text-to-video, an

HTTP Request
Marketing & Ads

This workflow is designed to manage the assignment and validation of unique QR code coupons within a lead generation system with SuiteCRM.

HTTP Request, Form Trigger, Google Sheets +1
Marketing & Ads

This workflow acts as an instant SDR that replies to new inbound leads across multiple channels in real time. It first captures and normalizes all incoming lead data into a unified structure. The work

Google Sheets, HTTP Request, Gmail +1