{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "02fc10cd-dd94-44d9-8ba0-638f9e9e206b",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -352
      ],
      "parameters": {
        "color": 7,
        "width": 1024,
        "height": 208,
        "content": "## Need more advanced automation solutions? Contact us for custom enterprise workflows!\n\n# Growth-AI.fr\n\n## https://www.linkedin.com/in/allanvaccarizi/\n## https://www.linkedin.com/in/hugo-marinier-%F0%9F%A7%B2-6537b633/"
      },
      "typeVersion": 1
    },
    {
      "id": "80670753-ccf4-4712-9017-2ba437a02b86",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -768
      ],
      "parameters": {
        "color": 7,
        "width": 1024,
        "height": 400,
        "content": "![Logo Growth AI](https://cdn.prod.website-files.com/6825df5b20329ba581df4914/68d413c43f8729fa336568a6_Logo_horizontal.png)"
      },
      "typeVersion": 1
    },
    {
      "id": "7cb1775e-97ca-4aa2-8524-428a236ba45b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -576,
        -112
      ],
      "parameters": {
        "width": 480,
        "height": 592,
        "content": "## Untitled workflow\n\n### How it works\n\n1. The workflow is triggered manually and fetches a list of records from an Airtable base.\n2. It loops over each record one by one using a batch iterator.\n3. For each record, it calls the Apify LinkedIn scraper API to retrieve profile information.\n4. The enriched LinkedIn data is written back to the corresponding Airtable record, then the loop continues until all records are processed.\n\n### Setup steps\n\n- - [ ] Connect your **Airtable** credential in both the 'Search records' and 'Update record' nodes, and configure the correct base, table, and field mappings.\n- - [ ] Obtain an **Apify API key** and configure it in the 'Get Linkedin profil info' HTTP Request node (the POST call to `api.apify.com`).\n- - [ ] Ensure the Airtable records contain a valid LinkedIn profile URL field that the Apify actor can consume.\n- - [ ] Review and adjust the fields being written back in 'Update record' to match your Airtable schema.\n\n### Customization\n\nYou can adjust the batch size in 'Loop Over Items' to control API call rate and avoid hitting Apify rate limits. You can also add error-handling branches after the HTTP Request node to flag failed lookups in Airtable."
      },
      "typeVersion": 1
    },
    {
      "id": "fcdb35ea-8728-4fa7-9136-f5ae35323f29",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 320,
        "content": "## Trigger and fetch records\n\nManually starts the workflow and retrieves all relevant records from Airtable to be enriched."
      },
      "typeVersion": 1
    },
    {
      "id": "14accebc-ce27-47ec-8a2f-14604b1aad79",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 624,
        "height": 320,
        "content": "## Enrich and update LinkedIn data\n\nIterates over each Airtable record in a loop, calls the Apify LinkedIn scraper API to fetch profile details, and writes the results back to Airtable before advancing to the next record."
      },
      "typeVersion": 1
    },
    {
      "id": "480ea8c5-f462-4d79-b77c-474acb488ece",
      "name": "When Executed Manually",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        32,
        48
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a5797b2e-e41e-4c4f-bdfd-4ebadf7194af",
      "name": "Search Records in Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        240,
        48
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appnM9t2JxMCU2LQB",
          "cachedResultUrl": "https://airtable.com/appnM9t2JxMCU2LQB",
          "cachedResultName": "Test n8n"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblwpuUniCVfkhjVb",
          "cachedResultUrl": "https://airtable.com/appnM9t2JxMCU2LQB/tblwpuUniCVfkhjVb",
          "cachedResultName": "Table 1"
        },
        "options": {},
        "operation": "search",
        "filterByFormula": "{First name} = \"\""
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d1e0c08a-f946-461b-8971-9d5691a6a7b5",
      "name": "Loop Over Records in Batches",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        464,
        48
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "c929f431-c27c-41a8-8a60-19a89b879121",
      "name": "Fetch LinkedIn Profile via Apify",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        688,
        48
      ],
      "parameters": {
        "url": "https://api.apify.com/v2/acts/yZnhB5JewWf9xSmoM/run-sync-get-dataset-items",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"urls\": [\n    {\n      \"url\": \"{{ $json.fields['LinkedIn URL'] }}\"\n    }\n  ],\n  \"findContacts\": false,\n  \"findContacts.contactCompassToken\": \"\"\n} ",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "apifyApi"
      },
      "credentials": {
        "apifyApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4,
      "alwaysOutputData": true
    },
    {
      "id": "ce05768f-fa09-4b02-8a18-8a17b70b899e",
      "name": "Update LinkedIn Data in Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        896,
        48
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "appnM9t2JxMCU2LQB",
          "cachedResultUrl": "https://airtable.com/appnM9t2JxMCU2LQB",
          "cachedResultName": "Test n8n"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblwpuUniCVfkhjVb",
          "cachedResultUrl": "https://airtable.com/appnM9t2JxMCU2LQB/tblwpuUniCVfkhjVb",
          "cachedResultName": "Table 1"
        },
        "columns": {
          "value": {
            "id": "={{ $('Loop Over Records in Batches').first().json.id }}",
            "City": "={{ $json.geoLocationName }}",
            "Skills": "={{ [...new Set($json.skills.map(s => s.name))].map(s => `\u2022 ${s}`).join('\\n') }}",
            "Country": "={{ $json.geoCountryName }}",
            "Summary": "={{ $json.summary }}",
            "Headline": "={{ $json.headline }}",
            "Job title": "={{ $json.jobTitle }}",
            "Last name": "={{ $json.lastName }}",
            "Positions": "={{ $json.positions.map(p => {\n  const name = p.company?.name ?? 'N/A';\n  const title = p.title ?? (p.positions?.[0]?.title ?? 'N/A');\n  const duration = p.totalDuration ?? 'N/A';\n  return `\u2022 ${title} \u2014 ${name} (${duration})`;\n}).join('\\n') }}",
            "Educations": "={{ $json.educations.map(e => {\n  const school = e.schoolName ?? 'N/A';\n  const degree = e.degreeName || e.fieldOfStudy || 'N/A';\n  const start = e.timePeriod?.startDate?.year ?? '';\n  const end = e.timePeriod?.endDate?.year ?? 'present';\n  return `\u2022 ${degree} \u2014 ${school} (${start}\u2013${end})`;\n}).join('\\n') }}",
            "First name": "={{ $json.firstName }}",
            "Is verified": "={{ $json.isVerified }}",
            "Company name": "={{ $json.companyName }}",
            "Certifications": "={{ $json.certifications.map(c => `\u2022 ${c.name} (${c.issuer})`).join('\\n') }}",
            "Follower count": "={{ $json.followerCount }}",
            "Company Linkedin URL": "={{ $json.companyLinkedinUrl }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "LinkedIn URL",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": false,
              "required": false,
              "displayName": "LinkedIn URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "First name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "First name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Last name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Headline",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Headline",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Country",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Country",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "City",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "City",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Job title",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Job title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company name",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Company name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Company Linkedin URL",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Company Linkedin URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Summary",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Positions",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Positions",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Educations",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Educations",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Certifications",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Certifications",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Follower count",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Follower count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Is verified",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Is verified",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Skills",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Skills",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    }
  ],
  "connections": {
    "Search Records in Airtable": {
      "main": [
        [
          {
            "node": "Loop Over Records in Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Records in Batches": {
      "main": [
        [],
        [
          {
            "node": "Fetch LinkedIn Profile via Apify",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch LinkedIn Profile via Apify": {
      "main": [
        [
          {
            "node": "Update LinkedIn Data in Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update LinkedIn Data in Airtable": {
      "main": [
        [
          {
            "node": "Loop Over Records in Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}