AutomationFlowsAI & RAG › Automated Lead Generation

Automated Lead Generation

Automated Lead Generation. Uses formTrigger, openAi, googleSheetsTrigger, googleSheets. Event-driven trigger; 55 nodes.

Event trigger★★★★★ complexityAI-powered55 nodesForm TriggerOpenAIGoogle Sheets TriggerGoogle SheetsHTTP Request
AI & RAG Trigger: Event Nodes: 55 Complexity: ★★★★★ AI nodes: yes Added:

This workflow follows the Form Trigger → Google Sheets 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
{
  "createdAt": "2025-05-22T01:59:29.922Z",
  "updatedAt": "2025-05-22T02:30:08.582Z",
  "id": "HsgRIDhMwmblezQt",
  "name": "Automated Lead Generation",
  "active": false,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {
        "formTitle": "Leads Search",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Job Title",
              "requiredField": true
            },
            {
              "fieldLabel": "Location",
              "requiredField": true
            },
            {
              "fieldLabel": "Number of Leads",
              "fieldType": "number",
              "requiredField": true
            }
          ]
        },
        "options": {}
      },
      "id": "6b5ec0e7-f70b-4d5a-a99d-58d1dfeefa1c",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        320,
        100
      ],
      "typeVersion": 2.2
    },
    {
      "parameters": {
        "fieldToSplitOut": "people",
        "options": {}
      },
      "id": "79cb8d29-ea6d-4660-a6f8-7701f7c17228",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        760,
        100
      ],
      "typeVersion": 1,
      "alwaysOutputData": false
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-3.5-turbo",
          "cachedResultName": "GPT-3.5-TURBO"
        },
        "messages": {
          "values": [
            {
              "content": "=remove the http or https://www.linkedin.com/in/ from this  {{ $json.linkedin_url }}"
            }
          ]
        },
        "options": {}
      },
      "id": "91d07433-2787-49d2-acf9-3de26b8aa363",
      "name": "OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        840,
        340
      ],
      "typeVersion": 1.8,
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "documentId": {
          "__rl": true,
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "mode": "list",
          "cachedResultName": "Apollo.ai leads and enrichment",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0"
        },
        "event": "rowAdded",
        "options": {}
      },
      "id": "7b343e61-03ea-4b01-ac1f-effceaee2934",
      "name": "Google Sheets Trigger2",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        120,
        540
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "content": "## Automated Lead Generation and Enrichment Workflow\n\nDescription: This workflow automates lead generation by collecting job title, location, and lead count via a form, using Apollo.io to fetch leads, and OpenAI to extract LinkedIn usernames. It stores and updates lead data in Google Sheets, validating email addresses and tracking scrape statuses for efficient lead management.\n",
        "height": 1020,
        "width": 1820
      },
      "id": "a29aecf8-1c2c-4c01-8dc9-13d46ed819be",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -100,
        -100
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "e3bfe30e-9136-4ac9-b3da-c26eb678153b",
              "name": "id",
              "type": "string",
              "value": "={{ $json.id }}"
            },
            {
              "id": "d45c81fb-1461-45fd-be95-d5d9901d72d7",
              "name": "name",
              "type": "string",
              "value": "={{ $json.name }}"
            },
            {
              "id": "b4b8f660-7758-4a5f-a8f6-dc8ab6355132",
              "name": "linkedin_url",
              "type": "string",
              "value": "={{ $json.linkedin_url }}"
            },
            {
              "id": "399f533a-6e6b-4f40-8ed8-aa5dd39017cd",
              "name": "title",
              "type": "string",
              "value": "={{ $json.title }}"
            },
            {
              "id": "227d34c5-17db-4436-b0c2-f74e5ae453f2",
              "name": "organization",
              "type": "string",
              "value": "={{ $json.employment_history[0].organization_name }}"
            }
          ]
        },
        "options": {}
      },
      "id": "baa08eb4-12fd-4cc4-8bae-5434f301c638",
      "name": "Clean Data",
      "type": "n8n-nodes-base.set",
      "position": [
        980,
        100
      ],
      "typeVersion": 3.4
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "mode": "list",
          "cachedResultName": "Apollo.ai leads and enrichment",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "extract_username_status": "finished",
            "apollo_id": "={{ $('Get Pending Username Row').item.json.apollo_id }}",
            "linkedin_username": "={{ $json.message.content }}"
          },
          "matchingColumns": [
            "apollo_id"
          ],
          "schema": [
            {
              "id": "apollo_id",
              "displayName": "apollo_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "organization",
              "displayName": "organization",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "title",
              "displayName": "title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "linkedin_url",
              "displayName": "linkedin_url",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "linkedin_username",
              "displayName": "linkedin_username",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "extract_username_status",
              "displayName": "extract_username_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "email_address",
              "displayName": "email_address",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "contacts_scrape_status",
              "displayName": "contacts_scrape_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "about_linkedin_profile",
              "displayName": "about_linkedin_profile",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "profile_summary_scrape",
              "displayName": "profile_summary_scrape",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "recent_posts_summary",
              "displayName": "recent_posts_summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "posts_scrape_status",
              "displayName": "posts_scrape_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "f8e81bf9-95f6-4c13-a8df-39a2b02ab90a",
      "name": "Add Linkedin Username",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1180,
        340
      ],
      "typeVersion": 4.5
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM",
          "mode": "list",
          "cachedResultName": "Apollo.ai leads and enrichment",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "extract_username_status",
              "lookupValue": "pending"
            }
          ]
        },
        "options": {}
      },
      "id": "8d237f2d-9ac5-4605-be0c-c2e1980b77ec",
      "name": "Get Pending Username Row",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        600,
        340
      ],
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM",
          "mode": "list",
          "cachedResultName": "Apollo.ai leads and enrichment",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "apollo_id": "={{ $('Get Pending Email Statuses').item.json.apollo_id }}",
            "email_address": "={{ $json.data.email }}",
            "contacts_scrape_status": "finished"
          },
          "matchingColumns": [
            "apollo_id"
          ],
          "schema": [
            {
              "id": "apollo_id",
              "displayName": "apollo_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "organization",
              "displayName": "organization",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "title",
              "displayName": "title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "linkedin_url",
              "displayName": "linkedin_url",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "linkedin_username",
              "displayName": "linkedin_username",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "extract_username_status",
              "displayName": "extract_username_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "email_address",
              "displayName": "email_address",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "contacts_scrape_status",
              "displayName": "contacts_scrape_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "about_linkedin_profile",
              "displayName": "about_linkedin_profile",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "profile_summary_scrape",
              "displayName": "profile_summary_scrape",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "recent_posts_summary",
              "displayName": "recent_posts_summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "posts_scrape_status",
              "displayName": "posts_scrape_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "cb4e4fbe-4efd-4047-91f9-7978ead268cb",
      "name": "Add Email Address",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1440,
        460
      ],
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "dd16c397-c6f6-4a91-b92c-24a1f24b707f",
              "operator": {
                "type": "string",
                "operation": "notContains"
              },
              "leftValue": "={{ $json.data.mx_record }}",
              "rightValue": "null"
            },
            {
              "id": "bc3200af-7ae4-4944-b410-ebb459e2d927",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $json.data.result }}",
              "rightValue": "deliverable"
            }
          ],
          "combinator": "and"
        },
        "looseTypeValidation": true,
        "options": {}
      },
      "id": "540473e2-889d-4037-9e13-ae952cbe6871",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        1100,
        540
      ],
      "typeVersion": 2.2
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM",
          "mode": "list",
          "cachedResultName": "Apollo.ai leads and enrichment",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "apollo_id": "={{ $('Get Pending Email Statuses').item.json.apollo_id }}",
            "contacts_scrape_status": "invalid_email"
          },
          "matchingColumns": [
            "apollo_id"
          ],
          "schema": [
            {
              "id": "apollo_id",
              "displayName": "apollo_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "organization",
              "displayName": "organization",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "title",
              "displayName": "title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "linkedin_url",
              "displayName": "linkedin_url",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "linkedin_username",
              "displayName": "linkedin_username",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "extract_username_status",
              "displayName": "extract_username_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "email_address",
              "displayName": "email_address",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "contacts_scrape_status",
              "displayName": "contacts_scrape_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "about_linkedin_profile",
              "displayName": "about_linkedin_profile",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "profile_summary_scrape",
              "displayName": "profile_summary_scrape",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "recent_posts_summary",
              "displayName": "recent_posts_summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "posts_scrape_status",
              "displayName": "posts_scrape_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "5371405a-1c75-4ed4-96f1-6f4b501ac044",
      "name": "Mark Invalid Email",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1440,
        660
      ],
      "typeVersion": 4.5
    },
    {
      "parameters": {
        "url": "=https://api.mails.so/v1/validate?email={{ $json.person.email }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-mails-api-key",
              "value": "83bd75d6-5fd4-4ea9-8554-5e2b1ba90893"
            }
          ]
        },
        "options": {}
      },
      "id": "fbe46915-8e2c-447f-bd49-e9b8bf31dcca",
      "name": "Confirm Email Validity",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        840,
        540
      ],
      "typeVersion": 4.2
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "mode": "list",
          "cachedResultName": "Apollo.ai leads and enrichment",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "contacts_scrape_status",
              "lookupValue": "pending"
            }
          ]
        },
        "options": {}
      },
      "id": "e56912a6-cc65-4159-8241-ba7667526665",
      "name": "Get Pending Email Statuses",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        360,
        540
      ],
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "documentId": {
          "__rl": true,
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "mode": "list",
          "cachedResultName": "Apollo.ai leads and enrichment",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0"
        },
        "event": "rowAdded",
        "options": {}
      },
      "id": "baefe757-1500-4535-9f7c-896c87656707",
      "name": "Google Sheets Trigger3",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        60,
        1020
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "content": "## LinkedIn Profile Summary Enrichment Workflow\nThis workflow automates the enrichment of lead data by fetching LinkedIn profile details for records marked as \"pending\" in a Google Sheets document, using the LinkedIn Data API. It cleans and summarizes the profile data with OpenAI, then updates the Google Sheet with the summarized profile and status, marking failed attempts if errors occur.",
        "height": 700,
        "width": 1320,
        "color": 6
      },
      "id": "3c72ed95-7958-48ba-b686-cbe6966213d2",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        920
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "url": "https://linkedin-data-api.p.rapidapi.com/get-profile-posts",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "username",
              "value": "={{ $json.linkedin_username }}"
            },
            {
              "name": "start",
              "value": "0"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "linkedin-data-api.p.rapidapi.com"
            },
            {
              "name": "x-rapidapi-key",
              "value": "faf88fbfc9msh9af1ccc8b3e2f05p11283cjsnc5302b552c5e"
            }
          ]
        },
        "options": {}
      },
      "id": "a245639a-6403-4925-9cac-fb6a3f4b3c0c",
      "name": "Get Profile Posts",
      "type": "n8n-nodes-base.httpRequest",
      "maxTries": 2,
      "position": [
        740,
        1860
      ],
      "retryOnFail": true,
      "typeVersion": 4.2,
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "url": "https://linkedin-data-api.p.rapidapi.com",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "username",
              "value": "={{ $json.linkedin_username }}"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "linkedin-data-api.p.rapidapi.com"
            },
            {
              "name": "x-rapidapi-key",
              "value": "faf88fbfc9msh9af1ccc8b3e2f05p11283cjsnc5302b552c5e"
            }
          ]
        },
        "options": {}
      },
      "id": "8995abaa-35ef-4e33-bbc7-555f242fd62f",
      "name": "Get About Profile",
      "type": "n8n-nodes-base.httpRequest",
      "maxTries": 2,
      "position": [
        860,
        1020
      ],
      "retryOnFail": true,
      "typeVersion": 4.2,
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "mode": "list",
          "cachedResultName": "Apollo.ai leads and enrichment",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "profile_summary_scrape",
              "lookupValue": "pending"
            }
          ]
        },
        "options": {}
      },
      "id": "8e47b6b2-9071-481a-be70-e2d46fef4f19",
      "name": "Get Pending About and Posts Rows",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        320,
        1020
      ],
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "return {\n  summary: $json.summary || null,\n  headline: $json.headline || null,\n  nationality: $json.geo?.country || null,\n  language: $json.languages?.[0]?.name || null,\n  education: $json.educations?.[0]?.schoolName || null,\n  fieldOfStudy: $json.educations?.[0]?.fieldOfStudy || null,\n  employment_company: $json.position?.[0]?.companyName || null,\n  company_industry: $json.position?.[0]?.companyIndustry || null,\n  position: $json.position?.[0]?.title || null,\n  company_location: $json.position?.[0]?.location || null,\n  employment_description_1: $json.position?.[0]?.description || null,\n};\n"
      },
      "id": "8864031e-d67c-4147-a0e5-b0cf26b17474",
      "name": "Clean Profile Data",
      "type": "n8n-nodes-base.code",
      "maxTries": 2,
      "position": [
        40,
        1320
      ],
      "retryOnFail": true,
      "typeVersion": 2,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "documentId": {
          "__rl": true,
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "mode": "list",
          "cachedResultName": "Apollo.ai leads and enrichment",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0"
        },
        "event": "rowAdded",
        "options": {}
      },
      "id": "bfdcdcb8-6a87-45f6-99a6-f2456031896b",
      "name": "Google Sheets Trigger4",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        20,
        1860
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "mode": "list",
          "cachedResultName": "Apollo.ai leads and enrichment",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "posts_scrape_status",
              "lookupValue": "unscraped"
            }
          ]
        },
        "options": {}
      },
      "id": "403f5704-4504-40d3-ad73-d66565a49641",
      "name": "Get Pending About and Posts Rows1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        260,
        1860
      ],
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const data = $json.data || [];\n\nfunction getText(post, reshared = false) {\n  if (!post) return \"\";\n  return reshared ? (post.resharedPost?.text || \"\") : (post.text || \"\");\n}\n\nfunction getDate(post) {\n  if (!post) return \"\";\n  return post.postedDate || post.postedDateTimestamp || \"\";\n}\n\nreturn {\n  json: {\n    post_1: getText(data[0]),\n    post_1_date: getDate(data[0]),\n\n    post_2: getText(data[1]),\n    post_2_date: getDate(data[1]),\n\n    post_3: getText(data[2]),\n    post_3_date: getDate(data[2]),\n\n    \n  }\n};\n"
      },
      "id": "99b60d7d-5926-41ac-ab49-2df225612647",
      "name": "Clean Posts Data",
      "type": "n8n-nodes-base.code",
      "maxTries": 2,
      "position": [
        1020,
        1860
      ],
      "retryOnFail": true,
      "typeVersion": 2,
      "waitBetweenTries": 3000,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "content": "## LinkedIn Posts Scraping and Lead Enrichment Workflow\nThis workflow retrieves recent LinkedIn posts for leads marked \"unscraped\" in a Google Sheet, using the LinkedIn Data API, and summarizes them with OpenAI to enhance lead profiles for personalized outreach. It updates the Google Sheet with post summaries, tracks failed attempts, and transfers fully enriched profiles (with validated emails, profile summaries, and post summaries) to a separate Enriched Leads Database.",
        "height": 560,
        "width": 2420,
        "color": 4
      },
      "id": "3a5058bb-295e-48b4-aa36-3404d846fe98",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        1640
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "documentId": {
          "__rl": true,
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "mode": "list",
          "cachedResultName": "Apollo.ai leads and enrichment",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0"
        },
        "event": "rowAdded",
        "options": {}
      },
      "id": "d79961b6-4315-46d0-9931-eb5bce321e3b",
      "name": "Google Sheets Trigger5",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        1300,
        2380
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "weeksInterval": 4,
              "triggerAtDay": [
                2
              ],
              "triggerAtHour": 8
            }
          ]
        }
      },
      "id": "ae2cc143-6110-4baa-afb2-0f2f22853204",
      "name": "Schedule Trigger2",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        2220,
        300
      ],
      "typeVersion": 1.2
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "mode": "list",
          "cachedResultName": "Apollo.ai leads and enrichment",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "contacts_scrape_status",
              "lookupValue": "invalid_email"
            }
          ]
        },
        "options": {}
      },
      "id": "5d26dd4e-a569-4b28-a99d-4bc4d8a957c0",
      "name": "get invalid email rows",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2460,
        1140
      ],
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "mode": "list",
          "cachedResultName": "Apollo.ai leads and enrichment",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "apollo_id": "={{ $json.apollo_id }}",
            "contacts_scrape_status": "pending"
          },
          "matchingColumns": [
            "apollo_id"
          ],
          "schema": [
            {
              "id": "apollo_id",
              "displayName": "apollo_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "organization",
              "displayName": "organization",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "title",
              "displayName": "title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "linkedin_url",
              "displayName": "linkedin_url",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "linkedin_username",
              "displayName": "linkedin_username",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "extract_username_status",
              "displayName": "extract_username_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "email_address",
              "displayName": "email_address",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "contacts_scrape_status",
              "displayName": "contacts_scrape_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "about_linkedin_profile",
              "displayName": "about_linkedin_profile",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "profile_summary_scrape",
              "displayName": "profile_summary_scrape",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "recent_posts_summary",
              "displayName": "recent_posts_summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "posts_scrape_status",
              "displayName": "posts_scrape_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "e87ab436-3a65-4ac5-9e50-6ccd164008e6",
      "name": "update_to_pending",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2680,
        1140
      ],
      "typeVersion": 4.5
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "mode": "list",
          "cachedResultName": "Apollo.ai leads and enrichment",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "profile_summary_scrape",
              "lookupValue": "failed"
            }
          ]
        },
        "options": {}
      },
      "id": "d146a585-962b-4944-ae8c-3aed66e436b6",
      "name": "get_failed_profile_summary_rows",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2440,
        300
      ],
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "mode": "list",
          "cachedResultName": "Apollo.ai leads and enrichment",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "apollo_id": "={{ $json.apollo_id }}",
            "profile_summary_scrape": "pending"
          },
          "matchingColumns": [
            "apollo_id"
          ],
          "schema": [
            {
              "id": "apollo_id",
              "displayName": "apollo_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "organization",
              "displayName": "organization",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "title",
              "displayName": "title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "linkedin_url",
              "displayName": "linkedin_url",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "linkedin_username",
              "displayName": "linkedin_username",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "extract_username_status",
              "displayName": "extract_username_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "email_address",
              "displayName": "email_address",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "contacts_scrape_status",
              "displayName": "contacts_scrape_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "about_linkedin_profile",
              "displayName": "about_linkedin_profile",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "profile_summary_scrape",
              "displayName": "profile_summary_scrape",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "recent_posts_summary",
              "displayName": "recent_posts_summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "posts_scrape_status",
              "displayName": "posts_scrape_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "row_number",
              "displayName": "row_number",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "readOnly": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "34710ca4-038d-41bb-84dd-ee3789387385",
      "name": "update_to_pending1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2660,
        300
      ],
      "typeVersion": 4.5
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "weeksInterval": 4,
              "triggerAtDay": [
                2
              ],
              "triggerAtHour": 8
            }
          ]
        }
      },
      "id": "a02447e6-48a2-4194-b9a9-619cc92adb18",
      "name": "Schedule Trigger3",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        2280,
        760
      ],
      "typeVersion": 1.2
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "mode": "list",
          "cachedResultName": "Apollo.ai leads and enrichment",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "posts_scrape_status",
              "lookupValue": "failed"
            }
          ]
        },
        "options": {}
      },
      "id": "148d3054-e631-4e3b-9791-5d0e8c22f5f4",
      "name": "get_failed_posts_summary_rows1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2500,
        760
      ],
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-3.5-turbo",
          "cachedResultName": "GPT-3.5-TURBO"
        },
        "messages": {
          "values": [
            {
              "content": "=Below are the most recent posts and reposts from a LinkedIn user. Summarize them collectively in no more than two short paragraphs. Focus on capturing the main themes, tone, and any recurring interests or professional concerns.\n\nAvoid listing each post separately \u2014 instead, synthesize the information into a narrative that gives a clear idea of what this person is currently focused on or passionate about.\n\nPosts: {{ $json.postsString }}\n\nKeep it insightful but brief \u2014 no more than 2 concise paragraphs."
            }
          ]
        },
        "simplify": false,
        "options": {}
      },
      "id": "3a83e602-0c27-405b-b6eb-a3df733610dc",
      "name": "Posts AI Summarizer",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1660,
        1780
      ],
      "executeOnce": false,
      "typeVersion": 1.8
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-3.5-turbo",
          "cachedResultName": "GPT-3.5-TURBO"
        },
        "messages": {
          "values": [
            {
              "content": "=Please summarize the following linkedin profile data {{ $json.profileString }} for a lead I want to cold email. I want to combine this summary with another information about them to send personalied emails, so please make sure you include relevant bits in the summary"
            }
          ]
        },
        "simplify": false,
        "options": {}
      },
      "id": "dd3f98ed-b573-477c-8941-6a2d0d66dfbd",
      "name": "AI Profile Summarizer",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        520,
        1240
      ],
      "executeOnce": false,
      "typeVersion": 1.8,
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "mode": "list",
          "cachedResultName": "Apollo.ai leads and enrichment",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "apollo_id": "={{ $('Get Pending About and Posts Rows').item.json.apollo_id }}",
            "about_linkedin_profile": "={{ $json.choices[0].message.content }}",
            "profile_summary_scrape": "completed"
          },
          "matchingColumns": [
            "apollo_id"
          ],
          "schema": [
            {
              "id": "apollo_id",
              "displayName": "apollo_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "organization",
              "displayName": "organization",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "title",
              "displayName": "title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "linkedin_url",
              "displayName": "linkedin_url",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "linkedin_username",
              "displayName": "linkedin_username",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "extract_username_status",
              "displayName": "extract_username_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "email_address",
              "displayName": "email_address",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            },
            {
              "id": "contacts_scrape_status",
        

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

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

About this workflow

Automated Lead Generation. Uses formTrigger, openAi, googleSheetsTrigger, googleSheets. Event-driven trigger; 55 nodes.

Source: https://github.com/AndersonNascimentoDosSantos/n8n-workflow-backup/blob/main/automated-lead-generation-HsgRIDhMwmblezQt.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

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

AI & RAG

Note: Now includes an Apify alternative for Rapid API (Some users can't create new accounts on Rapid API, so I have added an alternative for you. But immediately you are able to get access to Rapid AP

Form Trigger, Google Sheets Trigger, OpenAI +2
AI & RAG

This system automates LinkedIn lead generation and enrichment in six clear stages: Lead Collection (via Apollo.io) Automatically pulls leads based on keywords, roles, or industries using Apollo’s API.

Form Trigger, OpenAI, Google Sheets Trigger +2
AI & RAG

This n8n workflow automates the process of retrieving products from Printify, generating optimized product titles and descriptions, and updating them back to the platform. It leverages OpenAI for cont

HTTP Request, Tool Calculator, Tool Wikipedia +3
AI & RAG

An n8n-based automation that generates client proposals from a form, lets you review everything in one place, and sends the proposal only when you approve it.

Form Trigger, Google Sheets Trigger, OpenAI +4
AI & RAG

Printify Automation - Update Title and Description - AlexK1919. Uses httpRequest, toolCalculator, toolWikipedia, googleSheetsTrigger. Event-driven trigger; 26 nodes.

HTTP Request, Tool Calculator, Tool Wikipedia +3