AutomationFlowsMarketing & Ads › Lead Generation Pipeline

Lead Generation Pipeline

Lead Generation Pipeline. Uses facebookTrigger, googleSheetsTrigger, httpRequest. Event-driven trigger; 10 nodes.

Event trigger★★★★☆ complexity10 nodesFacebook TriggerGoogle Sheets TriggerHTTP Request
Marketing & Ads Trigger: Event Nodes: 10 Complexity: ★★★★☆ Added:

This workflow follows the Googlesheetstrigger → HTTP Request recipe pattern — see all workflows that pair these two integrations.

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 Generation Pipeline",
  "nodes": [
    {
      "parameters": {
        "eventsUi": {
          "eventValues": [
            {
              "name": "leadgen"
            }
          ]
        }
      },
      "name": "Facebook Lead Ads Trigger",
      "type": "n8n-nodes-base.facebookTrigger",
      "typeVersion": 1,
      "position": [
        250,
        250
      ]
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "value": "Sheet1",
          "mode": "list",
          "cachedResultName": "Sheet1"
        },
        "options": {}
      },
      "name": "Google Sheets Trigger",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "typeVersion": 2,
      "position": [
        250,
        400
      ]
    },
    {
      "parameters": {
        "jsCode": "// Extract lead data from Facebook Lead Ads or Google Sheets\nconst items = [];\n\nfor (const item of $input.all()) {\n  let leadData = {};\n  const data = item.json;\n  \n  // Check if data is from Facebook Lead Ads\n  if (data.leadgen_id || data.form_id) {\n    const fieldData = data.field_data || [];\n    leadData = {\n      name: fieldData.find(f => f.name === 'full_name')?.values?.[0] || data.name || '',\n      email: fieldData.find(f => f.name === 'email')?.values?.[0] || data.email || '',\n      phone: fieldData.find(f => f.name === 'phone_number')?.values?.[0] || data.phone || '',\n      job_title: fieldData.find(f => f.name === 'job_title')?.values?.[0] || data.job_title || '',\n      company: fieldData.find(f => f.name === 'company_name')?.values?.[0] || data.company || '',\n      comments: fieldData.find(f => f.name === 'comments')?.values?.[0] || data.comments || '',\n      source: 'facebook'\n    };\n  } \n  // Check if data is from Google Sheets\n  else {\n    // Google Sheets data comes as direct properties\n    // Assuming columns: name, email, Phone number, Job Tittle, company, comments\n    leadData = {\n      name: data.name || data.Name || data.full_name || data['Full Name'] || '',\n      email: data.email || data.Email || '',\n      phone: data['Phone number'] || data.phone || data.Phone || data.phone_number || data['Phone Number'] || '',\n      job_title: data['Job Tittle'] || data.job_title || data['Job Title'] || data.title || data.Title || '',\n      company: data.company || data.Company || data.company_name || data['Company Name'] || '',\n      comments: data.comments || data.Comments || data.comment || data.Comment || '',\n      source: 'google_sheets'\n    };\n  }\n  \n  items.push({ json: leadData });\n}\n\nreturn items;"
      },
      "name": "Process Lead Data",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        450,
        325
      ]
    },
    {
      "parameters": {
        "url": "https://marcelino-insecure-staci.ngrok-free.dev/pipeline/run",
        "method": "POST",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "ngrok-skip-browser-warning",
              "value": "true"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "dry_run",
              "value": "=false"
            },
            {
              "name": "enrichment_mode",
              "value": "=ai"
            },
            {
              "name": "lead_count",
              "value": "=200"
            },
            {
              "name": "channel",
              "value": "=both"
            },
            {
              "name": "lead_data",
              "value": "={{ { \"name\": $json.name, \"email\": $json.email, \"phone\": $json.phone, \"job_title\": $json.job_title, \"company\": $json.company, \"comments\": $json.comments, \"source\": $json.source } }}"
            }
          ]
        },
        "options": {}
      },
      "name": "Run Pipeline",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        650,
        325
      ]
    },
    {
      "parameters": {
        "amount": 5,
        "unit": "seconds"
      },
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        850,
        325
      ]
    },
    {
      "parameters": {
        "url": "https://marcelino-insecure-staci.ngrok-free.dev/metrics",
        "method": "GET",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "ngrok-skip-browser-warning",
              "value": "true"
            }
          ]
        },
        "options": {}
      },
      "name": "Get Metrics",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        1050,
        325
      ]
    },
    {
      "parameters": {
        "conditions": {
          "boolean": [
            {
              "value1": "={{ $json.pipeline_running }}",
              "value2": true
            }
          ]
        }
      },
      "name": "Check If Running",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        1250,
        325
      ]
    },
    {
      "parameters": {
        "amount": 3,
        "unit": "seconds"
      },
      "name": "Wait for Completion",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        1450,
        225
      ]
    },
    {
      "parameters": {
        "url": "https://marcelino-insecure-staci.ngrok-free.dev/metrics",
        "method": "GET",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "ngrok-skip-browser-warning",
              "value": "true"
            }
          ]
        },
        "options": {}
      },
      "name": "Get Final Metrics",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        1450,
        425
      ]
    },
    {
      "parameters": {
        "url": "https://marcelino-insecure-staci.ngrok-free.dev/leads",
        "method": "GET",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "ngrok-skip-browser-warning",
              "value": "true"
            }
          ]
        },
        "qs": {
          "limit": 50
        },
        "options": {}
      },
      "name": "Get Leads",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        1650,
        425
      ]
    }
  ],
  "connections": {
    "Facebook Lead Ads Trigger": {
      "main": [
        [
          {
            "node": "Process Lead Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets Trigger": {
      "main": [
        [
          {
            "node": "Process Lead Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Lead Data": {
      "main": [
        [
          {
            "node": "Run Pipeline",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Pipeline": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Get Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Metrics": {
      "main": [
        [
          {
            "node": "Check If Running",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Running": {
      "main": [
        [
          {
            "node": "Wait for Completion",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Final Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for Completion": {
      "main": [
        [
          {
            "node": "Get Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Final Metrics": {
      "main": [
        [
          {
            "node": "Get Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 0,
  "updatedAt": "2024-01-08T00:00:00.000Z",
  "versionId": "1"
}
Pro

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

About this workflow

Lead Generation Pipeline. Uses facebookTrigger, googleSheetsTrigger, httpRequest. Event-driven trigger; 10 nodes.

Source: https://github.com/zenitsu0509/mcp-leadgen-orchestrator/blob/c05ede29125c16bd20e783d7a979e094a67af24b/n8n/n8n-workflow.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

Enrich And Veryify Leads. Uses httpRequest, googleSheets, googleSheetsTrigger. Event-driven trigger; 32 nodes.

HTTP Request, Google Sheets, Google Sheets Trigger
Marketing & Ads

Transform your lead generation process with this powerful n8n workflow that automatically captures form submissions from Google Forms and creates organized lead cards in Trello.

Google Sheets Trigger, Trello, HTTP Request
Marketing & Ads

This template finds businesses on Google Maps → writes to Google Sheets → enriches + verifies email contact so your outreach stays clean and deliverable. It includes Sticky Notes** to explain the flow

HTTP Request, Google Sheets, @Verificaremails/N8N Nodes Verificaremails +1
Marketing & Ads

Description:

Google Sheets Trigger, Google Sheets, HTTP Request
Marketing & Ads

Description:

Google Sheets Trigger, Google Sheets, HTTP Request