{
  "name": "LinkedIn Profile Scraper → CSV (EnrichGrid API)",
  "nodes": [
    {
      "parameters": {},
      "id": "cb2441b1-8089-5e6c-ad71-237873ef8bbe",
      "name": "Start",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        320
      ]
    },
    {
      "parameters": {
        "jsCode": "// One LinkedIn profile URL (or slug) per line. Replace this list with a Google Sheets,\n// Airtable or CSV node that outputs a `linkedin_url` field, and keep the rest as is.\nconst urls = `\nhttps://www.linkedin.com/in/williamhgates\nhttps://www.linkedin.com/in/satyanadella\n`.split('\\n').map(s => s.trim()).filter(Boolean);\nreturn urls.map(linkedin_url => ({ json: { linkedin_url } }));"
      },
      "id": "bf89c02b-3933-57aa-8b47-9fac23e29bd5",
      "name": "LinkedIn URLs",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        220,
        320
      ]
    },
    {
      "parameters": {
        "batchSize": 1,
        "options": {}
      },
      "id": "ec162676-8b62-56c0-a83c-80465cfefb10",
      "name": "Loop over profiles",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        440,
        320
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://enrichgrid.com/v1/enrich/person",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {},
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ identifier: $json.linkedin_url }) }}"
      },
      "id": "7c32556b-463a-580c-a42c-a43d66362aaf",
      "name": "Enrich profile",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        660,
        420
      ],
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 3000,
      "credentials": {
        "httpHeaderAuth": {
          "name": "EnrichGrid API key"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose",
            "version": 2
          },
          "conditions": [
            {
              "id": "pending-check",
              "leftValue": "={{ $json.status }}",
              "rightValue": "pending",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "looseTypeValidation": true,
        "options": {}
      },
      "id": "357c191e-6148-535a-85a7-4956e4243b65",
      "name": "Still collecting?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        880,
        420
      ]
    },
    {
      "parameters": {
        "amount": 3,
        "unit": "seconds"
      },
      "id": "e93e42c1-8e89-558b-81b7-707c8dac9253",
      "name": "Wait 3 s",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        1100,
        560
      ],
      "webhookId": "a5bdb9bb-1ef3-5f82-8933-1677e413ea06"
    },
    {
      "parameters": {
        "method": "GET",
        "url": "=https://enrichgrid.com/v1/lookups/{{ $json.id }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {}
      },
      "id": "ac76c0a2-f37d-5977-819a-df440113aa23",
      "name": "Check lookup",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1320,
        560
      ],
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 3000,
      "credentials": {
        "httpHeaderAuth": {
          "name": "EnrichGrid API key"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "f-linkedin_url",
              "name": "linkedin_url",
              "value": "={{ $('Loop over profiles').item.json.linkedin_url }}",
              "type": "string"
            },
            {
              "id": "f-found",
              "name": "found",
              "value": "={{ $json.found }}",
              "type": "string"
            },
            {
              "id": "f-first_name",
              "name": "first_name",
              "value": "={{ $json.profile?.first_name ?? '' }}",
              "type": "string"
            },
            {
              "id": "f-last_name",
              "name": "last_name",
              "value": "={{ $json.profile?.last_name ?? '' }}",
              "type": "string"
            },
            {
              "id": "f-headline",
              "name": "headline",
              "value": "={{ $json.profile?.headline ?? '' }}",
              "type": "string"
            },
            {
              "id": "f-current_title",
              "name": "current_title",
              "value": "={{ $json.profile?.current_title ?? '' }}",
              "type": "string"
            },
            {
              "id": "f-current_company",
              "name": "current_company",
              "value": "={{ $json.profile?.current_company_name ?? '' }}",
              "type": "string"
            },
            {
              "id": "f-seniority",
              "name": "seniority",
              "value": "={{ $json.profile?.seniority ?? '' }}",
              "type": "string"
            },
            {
              "id": "f-location",
              "name": "location",
              "value": "={{ $json.profile?.location ?? '' }}",
              "type": "string"
            },
            {
              "id": "f-country",
              "name": "country",
              "value": "={{ $json.profile?.location_country ?? '' }}",
              "type": "string"
            },
            {
              "id": "f-followers",
              "name": "followers",
              "value": "={{ $json.profile?.follower_count ?? '' }}",
              "type": "string"
            },
            {
              "id": "f-connections",
              "name": "connections",
              "value": "={{ $json.profile?.num_connections ?? '' }}",
              "type": "string"
            },
            {
              "id": "f-status",
              "name": "status",
              "value": "={{ $json.status }}",
              "type": "string"
            },
            {
              "id": "f-credits_charged",
              "name": "credits_charged",
              "value": "={{ $json.credits_charged }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "70c4a70f-e232-5842-b7ac-4e7dbeee1046",
      "name": "Pick columns",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1320,
        320
      ]
    },
    {
      "parameters": {
        "operation": "csv",
        "options": {
          "fileName": "linkedin-profiles.csv"
        }
      },
      "id": "35569c02-5c25-54b7-b536-3b1be9c959ed",
      "name": "Save as CSV",
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        660,
        160
      ]
    },
    {
      "parameters": {
        "content": "## LinkedIn Profile Scraper → CSV (EnrichGrid)\n1. Create a **Header Auth** credential named *EnrichGrid API key*: name `x-api-key`, value = your key from enrichgrid.com/dashboard/keys (50 free credits at signup).\n2. Put your LinkedIn URLs in **LinkedIn URLs** (or swap it for Google Sheets / Airtable).\n3. Execute. 1 credit per found profile; not-found lookups are free. Slow profiles answer `pending` and are re-checked every 3 s for free. For thousands of rows, upload the file at enrichgrid.com/dashboard/bulk.",
        "width": 620,
        "height": 280
      },
      "id": "9ef5c2c2-138e-5ebc-a3ff-19d14c4d56be",
      "name": "About",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -160
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "LinkedIn URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LinkedIn URLs": {
      "main": [
        [
          {
            "node": "Loop over profiles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop over profiles": {
      "main": [
        [
          {
            "node": "Save as CSV",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Enrich profile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich profile": {
      "main": [
        [
          {
            "node": "Still collecting?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Still collecting?": {
      "main": [
        [
          {
            "node": "Wait 3 s",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Pick columns",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 3 s": {
      "main": [
        [
          {
            "node": "Check lookup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check lookup": {
      "main": [
        [
          {
            "node": "Still collecting?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pick columns": {
      "main": [
        [
          {
            "node": "Loop over profiles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false
  }
}