{
  "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",
              "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": false
            },
            {
              "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": "910b9715-7751-49db-965a-c8aaf3c2c5e3",
      "name": "Update Profile Summary",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1000,
        1240
      ],
      "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,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1iGBmgNtQ1FOfEKQ2WvQIjzd0YMa800Ir43Rp0Tm7bBE/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "posts_scrape_status": "scraped",
            "recent_posts_summary": "={{ $json.choices[0].message.content }}",
            "apollo_id": "={{ $('Get Pending About and Posts Rows1').item.json.apollo_id }}"
          },
          "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": true
            },
            {
              "id": "recent_posts_summary",
              "displayName": "recent_posts_summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "posts_scrape_status",
              "displayName": "posts_scrape_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": 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": "546ce54b-a4cf-4ea0-8be8-4a89016afdc0",
      "name": "Update Posts Summary",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2120,
        1780
      ],
      "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": "contacts_scrape_status",
              "lookupValue": "finished"
            },
            {
              "lookupColumn": "profile_summary_scrape",
              "lookupValue": "completed"
            },
            {
              "lookupColumn": "posts_scrape_status",
              "lookupValue": "scraped"
            }
          ]
        },
        "options": {}
      },
      "id": "61e38e6a-5a68-4462-8b86-a860f0c169bc",
      "name": "Get Completely Enriched Profiles",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1520,
        2380
      ],
      "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 }}",
            "posts_scrape_status": "unscraped"
          },
          "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": 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": false
            },
            {
              "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": "465c84e3-29c3-4e34-9ed9-27b86f281973",
      "name": "update_to_unscraped",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2700,
        760
      ],
      "typeVersion": 4.5
    },
    {
      "parameters": {
        "operation": "appendOrUpdate",
        "documentId": {
          "__rl": true,
          "value": "1npW6ZR6a7hDhxXcKUPPSRfE9em9ZZ2-qiOxmbscYnjc",
          "mode": "list",
          "cachedResultName": "Enriched Leads Database",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1npW6ZR6a7hDhxXcKUPPSRfE9em9ZZ2-qiOxmbscYnjc/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1npW6ZR6a7hDhxXcKUPPSRfE9em9ZZ2-qiOxmbscYnjc/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Email Address": "={{ $json.email_address }}",
            "Lead Name": "={{ $json.name }}",
            "Company/Organization": "={{ $json.organization }}",
            "Position": "={{ $json.title }}",
            "Linkedin Profile Summary": "={{ $json.about_linkedin_profile }}",
            "Recent Posts Summary": "={{ $json.recent_posts_summary }}"
          },
          "matchingColumns": [
            "Email Address"
          ],
          "schema": [
            {
              "id": "Lead Name",
              "displayName": "Lead Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Email Address",
              "displayName": "Email Address",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Company/Organization",
              "displayName": "Company/Organization",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Position",
              "displayName": "Position",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Linkedin Profile Summary",
              "displayName": "Linkedin Profile Summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Recent Posts Summary",
              "displayName": "Recent Posts Summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "0e3e1148-1123-47fa-bbd7-1c695f578a07",
      "name": "Append to Enriched Leads Database",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1720,
        2380
      ],
      "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,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Xv9-U2Em_C-M5qTGCZGpSM9HJcchBQGKU6PQusLJEcM/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "apollo_id": "={{ $('Get Pending About and Posts Rows').item.json.apollo_id }}",
            "profile_summary_scrape": "failed"
          },
          "matchingColumns": [
            "apollo_id"
          ],
          "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,
              "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
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "51332706-3350-411f-bd72-fad3169c0e35",
      "name": "update status to failed",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        300,
        1400
      ],
      "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 About and Posts Rows1').item.json.apollo_id }}",
            "posts_scrape_status": "failed"
          },
          "matchingColumns": [
            "apollo_id"
          ],
          "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": 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,
              "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
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "68d55417-d3ba-4118-b7b8-dcf8173837b3",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1420,
        1940
      ],
      "typeVersion": 4.5
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const profile = item.json;\n\nreturn {\n  json: {\n    profileString: JSON.stringify(profile, null, 2) // Pretty print with 2-space indentation\n  }\n};"
      },
      "id": "5a6faac4-44ed-4c14-9083-7ccc78c945fa",
      "name": "Stringify Profile Data1",
      "type": "n8n-nodes-base.code",
      "position": [
        300,
        1240
      ],
      "typeVersion": 2
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const profile = item.json;\n\nreturn {\n  json: {\n    postsString: JSON.stringify(profile, null, 2) // Pretty print with 2-space indentation\n  }\n};"
      },
      "id": "e38b471d-60e8-4a77-9776-364fd366ead1",
      "name": "Stringify Posts Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1420,
        1780
      ],
      "typeVersion": 2
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "weeksInterval": 4,
              "triggerAtDay": [
                2
              ],
              "triggerAtHour": 8
            }
          ]
        }
      },
      "id": "bf912c92-10f9-4911-ba72-d2900efd51e1",
      "name": "Schedule Trigger1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        2240,
        1140
      ],
      "typeVersion": 1.2
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://api.apollo.io/api/v1/mixed_people/search",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Cache-Control",
              "value": "no-cache"
            },
            {
              "name": "accept",
              "value": "application/json"
            },
            {
              "name": "x-api-key",
              "value": "\"your-api_key_here\""
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"person_locations\": [\"{{ $json.Location }}\"],\n  \"person_titles\": [\"{{ $json['Job Title'] }}\"],\n  \"page\": 1,\n  \"per_page\": {{$json['Number of Leads']}},\n  \"projection\": [\"id\", \"name\", \"linkedin_url\", \"title\"]\n}",
        "options": {
          "response": {
            "response": {}
          }
        }
      },
      "id": "c7295ef5-3e4e-48c7-b6ac-4c67fd0f5352",
      "name": "Generate Leads with Apollo.io1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        560,
        100
      ],
      "typeVersion": 4.2
    },
    {
      "parameters": {
        "operation": "append",
        "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": "={{ $json.id }}",
            "name": "={{ $json.name }}",
            "organization": "={{ $json.organization }}",
            "title": "={{ $json.title }}",
            "linkedin_url": "={{ $json.linkedin_url }}",
            "extract_username_status": "pending",
            "contacts_scrape_status": "pending",
            "posts_scrape_status": "pending",
            "profile_summary_scrape": "pending"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "apollo_id",
              "displayName": "apollo_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "organization",
              "displayName": "organization",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "displayName": "title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin_url",
              "displayName": "linkedin_url",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": 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
            },
            {
              "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": 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
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1180,
        100
      ],
      "id": "783dc283-f25d-4176-98d3-862774a73c9e",
      "name": "Add Leads to Google Sheet"
    },
    {
      "parameters": {
        "url": "=https://blessed-gently-stag.ngrok-free.app/contacts",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        620,
        5000
      ],
      "id": "6367cd4b-2ef5-4bbd-9e13-71156309807f",
      "name": "HTTP Request"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.apollo.io/api/v1/people/match",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "reveal_personal_emails",
              "value": "true"
            },
            {
              "name": "reveal_phone_number",
              "value": "false"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Cache-Control",
              "value": "no-cache"
            },
            {
              "name": "accept",
              "value": "application/json"
            },
            {
              "name": "x-api-key",
              "value": "\"your_api_key\""
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "id",
              "value": "={{ $json.apollo_id }}"
            }
          ]
        },
        "options": {}
      },
      "id": "77ce3c40-425e-4130-b8cc-2a698ba9bd23",
      "name": "Get Email from Apollo11",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        580,
        540
      ],
      "typeVersion": 4.2
    },
    {
      "parameters": {
        "maxItems": 2
      },
      "type": "n8n-nodes-base.limit",
      "typeVersion": 1,
      "position": [
        540,
        1020
      ],
      "id": "46c1fd9a-3b82-41a1-9176-e13d9f4c58ff",
      "name": "Limit"
    },
    {
      "parameters": {
        "maxItems": 8
      },
      "type": "n8n-nodes-base.limit",
      "typeVersion": 1,
      "position": [
        480,
        1860
      ],
      "id": "93133e31-0614-43ae-b734-20490f46b207",
      "name": "Limit1"
    },
    {
      "parameters": {
        "content": "## Update Completely Enriched Profile to Final Database",
        "height": 360,
        "width": 960,
        "color": 4
      },
      "id": "921a3f16-0e4f-4631-a96d-bda7d2cb1cba",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1160,
        2260
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "content": "## Update posts summary status from failed back to pending",
        "height": 360,
        "width": 800,
        "color": 7
      },
      "id": "ec97e111-4258-4325-bc90-ae7f9b15605a",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2140,
        620
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "content": "## Update Contact Scrape Status from Invalid back to Pending",
        "height": 360,
        "width": 800,
        "color": 5
      },
      "id": "ad98e44e-0aea-4a41-9411-f1aa746ebd75",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2140,
        1060
      ],
      "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": "ef096805-05cc-4a4c-a3b1-856f3da65e3d",
      "name": "Google Sheets Trigger",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        360,
        340
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "content": "## Update profile summary status from failed back to pending",
        "height": 360,
        "width": 820,
        "color": 6
      },
      "id": "fca44a21-4028-4e66-873f-57836d5cbf8a",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2100,
        180
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "content": "## Scheduled Lead Status Reset Workflow\nThis workflow runs on a schedule every four weeks to identify Google Sheets rows with invalid email addresses or failed post summary scrapes. It updates the status of these rows to \"pending\" for email revalidation and \"unscraped\" for post rescraping, enabling automated retry attempts for lead enrichment.",
        "height": 1540,
        "width": 1280,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1820,
        0
      ],
      "id": "232bb7e5-959e-4af0-9cf0-3d2ed1c3d698",
      "name": "Sticky Note2"
    }
  ],
  "connections": {
    "On form submission": {
      "main": [
        [
          {
            "node": "Generate Leads with Apollo.io1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Clean Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI1": {
      "main": [
        [
          {
            "node": "Add Linkedin Username",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets Trigger2": {
      "main": [
        [
          {
            "node": "Get Pending Email Statuses",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Data": {
      "main": [
        [
          {
            "node": "Add Leads to Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Pending Username Row": {
      "main": [
        [
          {
            "node": "OpenAI1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Add Email Address",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Mark Invalid Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Confirm Email Validity": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Pending Email Statuses": {
      "main": [
        [
          {
            "node": "Get Email from Apollo11",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets Trigger3": {
      "main": [
        [
          {
            "node": "Get Pending About and Posts Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Profile Posts": {
      "main": [
        [
          {
            "node": "Clean Posts Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get About Profile": {
      "main": [
        [
          {
            "node": "Clean Profile Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Pending About and Posts Rows": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Profile Data": {
      "main": [
        [
          {
            "node": "Stringify Profile Data1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "update status to failed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets Trigger4": {
      "main": [
        [
          {
            "node": "Get Pending About and Posts Rows1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Pending About and Posts Rows1": {
      "main": [
        [
          {
            "node": "Limit1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Posts Data": {
      "main": [
        [
          {
            "node": "Stringify Posts Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets Trigger5": {
      "main": [
        [
          {
            "node": "Get Completely Enriched Profiles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger2": {
      "main": [
        [
          {
            "node": "get_failed_profile_summary_rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get invalid email rows": {
      "main": [
        [
          {
            "node": "update_to_pending",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get_failed_profile_summary_rows": {
      "main": [
        [
          {
            "node": "update_to_pending1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger3": {
      "main": [
        [
          {
            "node": "get_failed_posts_summary_rows1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get_failed_posts_summary_rows1": {
      "main": [
        [
          {
            "node": "update_to_unscraped",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Posts AI Summarizer": {
      "main": [
        [
          {
            "node": "Update Posts Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Profile Summarizer": {
      "main": [
        [
          {
            "node": "Update Profile Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Completely Enriched Profiles": {
      "main": [
        [
          {
            "node": "Append to Enriched Leads Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Stringify Profile Data1": {
      "main": [
        [
          {
            "node": "AI Profile Summarizer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Stringify Posts Data": {
      "main": [
        [
          {
            "node": "Posts AI Summarizer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "get invalid email rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Leads with Apollo.io1": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Email from Apollo11": {
      "main": [
        [
          {
            "node": "Confirm Email Validity",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit": {
      "main": [
        [
          {
            "node": "Get About Profile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit1": {
      "main": [
        [
          {
            "node": "Get Profile Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets Trigger": {
      "main": [
        [
          {
            "node": "Get Pending Username Row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "meta": null,
  "versionId": "df22e817-7369-43d7-9f51-c76a839c2040",
  "triggerCount": 0,
  "tags": []
}