AutomationFlowsAI & RAG › Lead Generation Automate on Linkedin - Personalisation, Enrichment

Lead Generation Automate on Linkedin - Personalisation, Enrichment

ByKrupal Patel @krupalpatel on n8n.io

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. Captures name, job title, company, and LinkedIn profile URL. You can kick off…

Event trigger★★★★★ complexityAI-powered55 nodesForm TriggerOpenAIGoogle Sheets TriggerGoogle SheetsHTTP Request
AI & RAG Trigger: Event Nodes: 55 Complexity: ★★★★★ AI nodes: yes Added:
Lead Generation Automate on Linkedin - Personalisation, Enrichment — n8n workflow card showing Form Trigger, OpenAI, Google Sheets Trigger integration

This workflow corresponds to n8n.io template #4685 — we link there as the canonical source.

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
{
  "id": "Dbzu6lmK6zWsyyQP",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Lead 1",
  "tags": [],
  "nodes": [
    {
      "id": "4cab7c48-1c69-479e-83ce-fe4d3974b5ce",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        220,
        140
      ],
      "parameters": {
        "options": {},
        "formTitle": "Leads Search",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Job Title",
              "requiredField": true
            },
            {
              "fieldLabel": "Location",
              "requiredField": true
            },
            {
              "fieldType": "number",
              "fieldLabel": "Number of Leads",
              "requiredField": true
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "5ed7d147-f2a2-4a9e-911f-45f5ca0bafdb",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        660,
        140
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "people"
      },
      "typeVersion": 1,
      "alwaysOutputData": false
    },
    {
      "id": "6851151e-6b2a-42b7-8e0a-729c650da6c4",
      "name": "OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        740,
        380
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-3.5-turbo",
          "cachedResultName": "GPT-3.5-TURBO"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=remove the http or https://www.linkedin.com/in/ from this  {{ $json.linkedin_url }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "f1a9b0fb-f9a8-48f5-b369-f52516214503",
      "name": "Google Sheets Trigger2",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        20,
        580
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk",
          "cachedResultName": "Apollo.ai leads and enrichment"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4c198be2-a508-4269-ad59-0e490caafd60",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        -60
      ],
      "parameters": {
        "width": 1820,
        "height": 1020,
        "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"
      },
      "typeVersion": 1
    },
    {
      "id": "4db87428-54a3-4110-bb3e-16ac2a64927b",
      "name": "Clean Data",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        140
      ],
      "parameters": {
        "options": {},
        "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 }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "a34921c3-cdae-4db0-9c7b-cd857d0cd552",
      "name": "Add Linkedin Username",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1080,
        380
      ],
      "parameters": {
        "columns": {
          "value": {
            "apollo_id": "={{ $('Get Pending Username Row').item.json.apollo_id }}",
            "linkedin_username": "={{ $json.message.content }}",
            "extract_username_status": "finished"
          },
          "schema": [
            {
              "id": "apollo_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "apollo_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "organization",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "organization",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin_url",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "linkedin_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin_username",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "linkedin_username",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "extract_username_status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "extract_username_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email_address",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "email_address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "contacts_scrape_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "contacts_scrape_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "about_linkedin_profile",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "about_linkedin_profile",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "profile_summary_scrape",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "profile_summary_scrape",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "recent_posts_summary",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "recent_posts_summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "posts_scrape_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "posts_scrape_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "apollo_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk",
          "cachedResultName": "Apollo.ai leads and enrichment"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "be0a482f-69be-4906-a944-ae480bddc445",
      "name": "Get Pending Username Row",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        500,
        380
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "pending",
              "lookupColumn": "extract_username_status"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit?usp=drivesdk",
          "cachedResultName": "Apollo.ai leads and enrichment"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "id": "f87ef1f1-ba4a-4104-9c4b-f6d93f770ede",
      "name": "Add Email Address",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1340,
        500
      ],
      "parameters": {
        "columns": {
          "value": {
            "apollo_id": "={{ $('Get Pending Email Statuses').item.json.apollo_id }}",
            "email_address": "={{ $json.data.email }}",
            "contacts_scrape_status": "finished"
          },
          "schema": [
            {
              "id": "apollo_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "apollo_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "organization",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "organization",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin_url",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "linkedin_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin_username",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "linkedin_username",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "extract_username_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "extract_username_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email_address",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "email_address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "contacts_scrape_status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "contacts_scrape_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "about_linkedin_profile",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "about_linkedin_profile",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "profile_summary_scrape",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "profile_summary_scrape",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "recent_posts_summary",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "recent_posts_summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "posts_scrape_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "posts_scrape_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "apollo_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit?usp=drivesdk",
          "cachedResultName": "Apollo.ai leads and enrichment"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "id": "1f9cb0e4-2b26-4948-9294-82d8abfab4eb",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        1000,
        580
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "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"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "d539aec1-0584-4d04-8d6c-0492d0ead4dd",
      "name": "Mark Invalid Email",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1340,
        700
      ],
      "parameters": {
        "columns": {
          "value": {
            "apollo_id": "={{ $('Get Pending Email Statuses').item.json.apollo_id }}",
            "contacts_scrape_status": "invalid_email"
          },
          "schema": [
            {
              "id": "apollo_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "apollo_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "organization",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "organization",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin_url",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "linkedin_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin_username",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "linkedin_username",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "extract_username_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "extract_username_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email_address",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "email_address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "contacts_scrape_status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "contacts_scrape_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "about_linkedin_profile",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "about_linkedin_profile",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "profile_summary_scrape",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "profile_summary_scrape",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "recent_posts_summary",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "recent_posts_summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "posts_scrape_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "posts_scrape_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "apollo_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit?usp=drivesdk",
          "cachedResultName": "Apollo.ai leads and enrichment"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "08fd30c9-acfe-4775-81fa-ccc3153160b8",
      "name": "Confirm Email Validity",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        740,
        580
      ],
      "parameters": {
        "url": "=https://api.mails.so/v1/validate?email={{ $json.person.email }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-mails-api-key",
              "value": "83bd75d6-5fd4-4ea9-8554-5e2b1ba90893"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "37ac82ac-ee91-42ed-8d62-9b5ba959fb25",
      "name": "Get Pending Email Statuses",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        260,
        580
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "pending",
              "lookupColumn": "contacts_scrape_status"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk",
          "cachedResultName": "Apollo.ai leads and enrichment"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "id": "5f5cfd40-520b-4abc-a073-bfa2aa89afb5",
      "name": "Google Sheets Trigger3",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -40,
        1060
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk",
          "cachedResultName": "Apollo.ai leads and enrichment"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4fe13d3a-553d-45e1-88d6-b75d53b4f58c",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        960
      ],
      "parameters": {
        "color": 6,
        "width": 1320,
        "height": 700,
        "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."
      },
      "typeVersion": 1
    },
    {
      "id": "f00b7fe0-1bb8-44b9-b19e-cca7576bd7fe",
      "name": "Get Profile Posts",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "maxTries": 2,
      "position": [
        640,
        1900
      ],
      "parameters": {
        "url": "https://linkedin-data-api.p.rapidapi.com/get-profile-posts",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "username",
              "value": "={{ $json.linkedin_username }}"
            },
            {
              "name": "start",
              "value": "0"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "linkedin-data-api.p.rapidapi.com"
            },
            {
              "name": "x-rapidapi-key",
              "value": "faf88fbfc9msh9af1ccc8b3e2f05p11283cjsnc5302b552c5e"
            }
          ]
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2
    },
    {
      "id": "102398c4-8760-4cc7-8664-293b5de3c460",
      "name": "Get About Profile",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "maxTries": 2,
      "position": [
        760,
        1060
      ],
      "parameters": {
        "url": "https://linkedin-data-api.p.rapidapi.com",
        "options": {},
        "sendQuery": true,
        "sendHeaders": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "username",
              "value": "={{ $json.linkedin_username }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "linkedin-data-api.p.rapidapi.com"
            },
            {
              "name": "x-rapidapi-key",
              "value": "faf88fbfc9msh9af1ccc8b3e2f05p11283cjsnc5302b552c5e"
            }
          ]
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2
    },
    {
      "id": "747e0b11-839f-4335-bf62-f695575372b1",
      "name": "Get Pending About and Posts Rows",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        220,
        1060
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "pending",
              "lookupColumn": "profile_summary_scrape"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk",
          "cachedResultName": "Apollo.ai leads and enrichment"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "id": "f5e0160c-2602-4e62-a230-4b4a73136b88",
      "name": "Clean Profile Data",
      "type": "n8n-nodes-base.code",
      "onError": "continueErrorOutput",
      "maxTries": 2,
      "position": [
        -60,
        1360
      ],
      "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"
      },
      "retryOnFail": true,
      "typeVersion": 2
    },
    {
      "id": "470a2381-fdcc-4e62-bda2-9ef81db3acb0",
      "name": "Google Sheets Trigger4",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -80,
        1900
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk",
          "cachedResultName": "Apollo.ai leads and enrichment"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b19f9d0d-b0fa-409a-b3e1-d9b2f52f25e8",
      "name": "Get Pending About and Posts Rows1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        160,
        1900
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "unscraped",
              "lookupColumn": "posts_scrape_status"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk",
          "cachedResultName": "Apollo.ai leads and enrichment"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "id": "3d42dfba-2a1c-4457-bc16-e868c597a381",
      "name": "Clean Posts Data",
      "type": "n8n-nodes-base.code",
      "onError": "continueErrorOutput",
      "maxTries": 2,
      "position": [
        920,
        1900
      ],
      "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"
      },
      "retryOnFail": true,
      "typeVersion": 2,
      "waitBetweenTries": 3000
    },
    {
      "id": "afa569d3-3fbc-4b16-b869-3461e442a740",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -220,
        1680
      ],
      "parameters": {
        "color": 4,
        "width": 2420,
        "height": 560,
        "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."
      },
      "typeVersion": 1
    },
    {
      "id": "31928be6-191f-4ec3-a88d-dbd7f613f1aa",
      "name": "Google Sheets Trigger5",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        1200,
        2420
      ],
      "parameters": {
        "event": "rowAdded",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk",
          "cachedResultName": "Apollo.ai leads and enrichment"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f0c78b3d-be0c-4113-8392-2d91c4f707d7",
      "name": "Schedule Trigger2",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        2120,
        340
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                2
              ],
              "triggerAtHour": 8,
              "weeksInterval": 4
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "0661680e-a4d0-4595-aef7-e832fc812f0e",
      "name": "get invalid email rows",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2360,
        1180
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "invalid_email",
              "lookupColumn": "contacts_scrape_status"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk",
          "cachedResultName": "Apollo.ai leads and enrichment"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "id": "d1da0dbc-85f8-4b95-88b4-7cf68e59560a",
      "name": "update_to_pending",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2580,
        1180
      ],
      "parameters": {
        "columns": {
          "value": {
            "apollo_id": "={{ $json.apollo_id }}",
            "contacts_scrape_status": "pending"
          },
          "schema": [
            {
              "id": "apollo_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "apollo_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "organization",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "organization",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin_url",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "linkedin_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin_username",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "linkedin_username",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "extract_username_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "extract_username_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email_address",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "email_address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "contacts_scrape_status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "contacts_scrape_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "about_linkedin_profile",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "about_linkedin_profile",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "profile_summary_scrape",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "profile_summary_scrape",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "recent_posts_summary",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "recent_posts_summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "posts_scrape_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "posts_scrape_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "apollo_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk",
          "cachedResultName": "Apollo.ai leads and enrichment"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "2f87a52a-83fa-4a57-90c3-7b9cf658091d",
      "name": "get_failed_profile_summary_rows",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2340,
        340
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "failed",
              "lookupColumn": "profile_summary_scrape"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk",
          "cachedResultName": "Apollo.ai leads and enrichment"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "id": "3ba33190-7e23-4b61-a12c-b014e04dec27",
      "name": "update_to_pending1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2560,
        340
      ],
      "parameters": {
        "columns": {
          "value": {
            "apollo_id": "={{ $json.apollo_id }}",
            "profile_summary_scrape": "pending"
          },
          "schema": [
            {
              "id": "apollo_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "apollo_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "organization",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "organization",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin_url",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "linkedin_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin_username",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "linkedin_username",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "extract_username_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "extract_username_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email_address",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "email_address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "contacts_scrape_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "contacts_scrape_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "about_linkedin_profile",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "about_linkedin_profile",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "profile_summary_scrape",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "profile_summary_scrape",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "recent_posts_summary",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "recent_posts_summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "posts_scrape_status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "posts_scrape_status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "apollo_id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1d99PlHkp9RPeSAtmATgQ4OC4Selcp8JSFLNuKx-n1EQ/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk",
          "cachedResultName": "Apollo.ai leads and enrichment"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "c84a23f2-c19b-4752-8195-6bb03dc2c3f4",
      "name": "Schedule Trigger3",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        2180,
        800
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggerAtDay": [
                2
              ],
              "triggerAtHour": 8,
              "weeksInterval": 4
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7dd1874a-3be3-4c8f-8118-d2f0881f06ba",
      "name": "get_failed_posts_summary_rows1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2400,
        800
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "failed",
              "lookupColumn": "posts_scrape_status"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit?usp=drivesdk",
          "cachedResultName": "Apollo.ai leads and enrichment"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "id": "2ebf97c9-381f-4823-8a08-c9943c1abf80",
      "name": "Posts AI Summarizer",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1560,
        1820
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-3.5-turbo",
          "cachedResultName": "GPT-3.5-TURBO"
        },
        "options": {},
        "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
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "executeOnce": false,
      "typeVersion": 1.8
    },
    {
      "id": "6dbcfab2-e3fe-46ed-9fa5-9301f0762815",
      "name": "AI Profile Summarizer",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        420,
        1280
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-3.5-turbo",
          "cachedResultName": "GPT-3.5-TURBO"
        },
        "options": {},
        "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
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "executeOnce": false,
      "typeVersion": 1.8
    },
    {
      "id": "a03e2002-840c-4792-a4aa-35b4a1886584",
      "name": "Update Profile Summary",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        900,
        1280
      ],
      "parameters": {
        "columns": {
          "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"
          },
          "schema": [
            {
              "id": "apollo_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "apollo_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "organization",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "organization",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id"

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

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. Captures name, job title, company, and LinkedIn profile URL. You can kick off…

Source: https://n8n.io/workflows/4685/ — 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 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

This workflow is designed for content creators, marketers, and automation enthusiasts who want to produce professional AI-generated videos and publish them automatically on social media — without edit

OpenAI, HTTP Request, Google Drive +3
AI & RAG

This workflow turns a user-submitted form with country or animal names into a cinematic video with animated scenes and immersive ambient audio. Using GPT-4 for prompt generation, Dumpling AI for visua

Form Trigger, OpenAI, HTTP Request +2