Unipile to send LinkedIn connections

    Shared 11/27/2025

    19 views

    Visual Workflow

    JSON Code

    {
      "id": "Qx6Cd0WGZ1pIjzXL",
      "meta": {
        "instanceId": "71a5a3ae40b179c34c7e1d3e14995b2efc91c44723d3269fa3021280fa909bf7",
        "templateCredsSetupCompleted": true
      },
      "name": "unipile to send linkedin connections",
      "tags": [],
      "nodes": [
        {
          "id": "27e2030c-1d12-4d4c-8692-6a4e10853973",
          "name": "Filter",
          "type": "n8n-nodes-base.filter",
          "position": [
            -1840,
            304
          ],
          "parameters": {
            "options": {},
            "conditions": {
              "options": {
                "version": 2,
                "leftValue": "",
                "caseSensitive": true,
                "typeValidation": "strict"
              },
              "combinator": "and",
              "conditions": [
                {
                  "id": "24634702-735e-4d78-9ba2-fc8401d1bcc3",
                  "operator": {
                    "type": "string",
                    "operation": "empty",
                    "singleValue": true
                  },
                  "leftValue": "={{ $json['Connection sent'] }}",
                  "rightValue": ""
                },
                {
                  "id": "9ab45df7-2a00-4770-8ab2-880c184ff1d6",
                  "operator": {
                    "name": "filter.operator.equals",
                    "type": "string",
                    "operation": "equals"
                  },
                  "leftValue": "",
                  "rightValue": ""
                }
              ]
            }
          },
          "typeVersion": 2.2
        },
        {
          "id": "dd14020f-9dd9-4f4c-8171-5da8202afe31",
          "name": "Code",
          "type": "n8n-nodes-base.code",
          "position": [
            -1312,
            304
          ],
          "parameters": {
            "jsCode": "// Extracts the LinkedIn username from a profile URL\nreturn items.map(item => {\n    const url = item.json['Linkedin Url']; // Get the URL from the input data\n    const match = url.match(/\\/in\\/([^/]+)/); // Extract everything after \"/in/\"\n    return {\n        json: {\n            username: match ? match[1] : null // Return the extracted username or null if not found\n        }\n    };\n});\n"
          },
          "typeVersion": 2
        },
        {
          "id": "4684c62c-d3cc-4e76-be88-868cd96118b1",
          "name": "Loop Over Items",
          "type": "n8n-nodes-base.splitInBatches",
          "position": [
            -880,
            304
          ],
          "parameters": {
            "options": {}
          },
          "typeVersion": 3
        },
        {
          "id": "61d52d10-51fb-4ede-a8ae-6eb051d93e19",
          "name": "Wait",
          "type": "n8n-nodes-base.wait",
          "position": [
            32,
            384
          ],
          "webhookId": "f758a228-1c53-4c6e-929b-f831876e0b23",
          "parameters": {
            "amount": 1
          },
          "typeVersion": 1.1
        },
        {
          "id": "b6401dd6-9f29-4174-b62c-9696ac4354db",
          "name": "Google Sheets",
          "type": "n8n-nodes-base.googleSheets",
          "position": [
            240,
            384
          ],
          "parameters": {
            "columns": {
              "value": {
                "company": "={{ $('getLinkedinUser').item.json.work_experience[0].company }}",
                "last_name": "={{ $('getLinkedinUser').item.json.last_name }}",
                "locations": "={{ $('getLinkedinUser').item.json.work_experience[0].location }}",
                "positions": "={{ $('getLinkedinUser').item.json.work_experience[0].position }}",
                "first_name": "={{ $('getLinkedinUser').item.json.first_name }}",
                "provider_id": "={{ $('getLinkedinUser').item.json.provider_id }}",
                "Linkedin Url": "={{ $('Loop Over Items').item.json['Linkedin Url'] }}",
                "Connection sent": "={{ $('sendLinkedinConnection').item.json.object }}"
              },
              "schema": [
                {
                  "id": "Linkedin Url",
                  "type": "string",
                  "display": true,
                  "removed": false,
                  "required": false,
                  "displayName": "Linkedin Url",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "Title",
                  "type": "string",
                  "display": true,
                  "required": false,
                  "displayName": "Title",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "Connection sent",
                  "type": "string",
                  "display": true,
                  "required": false,
                  "displayName": "Connection sent",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "first_name",
                  "type": "string",
                  "display": true,
                  "required": false,
                  "displayName": "first_name",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "last_name",
                  "type": "string",
                  "display": true,
                  "required": false,
                  "displayName": "last_name",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "locations",
                  "type": "string",
                  "display": true,
                  "required": false,
                  "displayName": "locations",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "company",
                  "type": "string",
                  "display": true,
                  "required": false,
                  "displayName": "company",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "positions",
                  "type": "string",
                  "display": true,
                  "required": false,
                  "displayName": "positions",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "provider_id",
                  "type": "string",
                  "display": true,
                  "required": false,
                  "displayName": "provider_id",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "row_number",
                  "type": "number",
                  "display": true,
                  "removed": true,
                  "readOnly": true,
                  "required": false,
                  "displayName": "row_number",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                }
              ],
              "mappingMode": "defineBelow",
              "matchingColumns": [
                "Linkedin Url"
              ],
              "attemptToConvertTypes": false,
              "convertFieldsToString": false
            },
            "options": {},
            "operation": "update",
            "sheetName": {
              "__rl": true,
              "mode": "list",
              "value": "gid=0",
              "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1RN7JW0aGmAoJ3PI9AukbtAMUIV08nyKk93ti0J72s9g/edit#gid=0",
              "cachedResultName": "Sheet1"
            },
            "documentId": {
              "__rl": true,
              "mode": "list",
              "value": "1RN7JW0aGmAoJ3PI9AukbtAMUIV08nyKk93ti0J72s9g",
              "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1RN7JW0aGmAoJ3PI9AukbtAMUIV08nyKk93ti0J72s9g/edit?usp=drivesdk",
              "cachedResultName": "Linkedin profile scarper "
            }
          },
          "typeVersion": 4.5
        },
        {
          "id": "ccc00e93-83be-4acc-8b95-d468cad2e65d",
          "name": "Wait1",
          "type": "n8n-nodes-base.wait",
          "position": [
            80,
            592
          ],
          "webhookId": "91d50559-70f2-4541-b934-94e185dc3ecd",
          "parameters": {
            "amount": 1
          },
          "typeVersion": 1.1
        },
        {
          "id": "c36b21cd-dc3b-4a06-965d-8bd63e0144c5",
          "name": "Edit Fields",
          "type": "n8n-nodes-base.set",
          "position": [
            -1104,
            304
          ],
          "parameters": {
            "options": {},
            "assignments": {
              "assignments": [
                {
                  "id": "85e65f5e-2c0f-49ed-ab1c-c055ae3d6803",
                  "name": "username",
                  "type": "string",
                  "value": "={{ $json.username }}"
                },
                {
                  "id": "7f83e48d-b563-4559-8a18-4d4bbbd5ccc9",
                  "name": "Linkedin Url",
                  "type": "string",
                  "value": "={{ $('Filter').item.json['Linkedin Url'] }}"
                }
              ]
            }
          },
          "typeVersion": 3.4
        },
        {
          "id": "2834ff0e-75d2-4d17-a527-d09f08f3aef1",
          "name": "Sticky Note",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -2064,
            192
          ],
          "parameters": {
            "color": 4,
            "width": 340,
            "height": 280,
            "content": "## Retrieve and filter qualified leads"
          },
          "typeVersion": 1
        },
        {
          "id": "8811b8f8-027b-468b-bd78-47b696a6121a",
          "name": "Sticky Note1",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -1568,
            192
          ],
          "parameters": {
            "color": 5,
            "width": 180,
            "height": 280,
            "content": "### Extract linkedin ID from url"
          },
          "typeVersion": 1
        },
        {
          "id": "83b5688f-59a2-4820-ab85-b362ce4ebc9e",
          "name": "Sticky Note2",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -1344,
            192
          ],
          "parameters": {
            "color": 3,
            "width": 180,
            "height": 280,
            "content": "### Save username and linkedin Url"
          },
          "typeVersion": 1
        },
        {
          "id": "bb030942-cb30-4e38-98b3-fc6f268a7373",
          "name": "getLinkedinUser",
          "type": "n8n-nodes-base.httpRequest",
          "onError": "continueRegularOutput",
          "position": [
            -416,
            352
          ],
          "parameters": {
            "url": "=https://api76.unipile.com:14/api/v1/users/{{ $json.username }}?linkedin_sections=%2A&account_id=pn6TkgP7TdyVS8N8ywg",
            "options": {},
            "sendQuery": true,
            "sendHeaders": true,
            "queryParameters": {
              "parameters": [
                {}
              ]
            },
            "headerParameters": {
              "parameters": [
                {
                  "name": "accept",
                  "value": "application/json"
                },
                {
                  "name": "X-API-KEY",
                  "value": "jJ1pr3T5./PKPNcAo="
                }
              ]
            }
          },
          "typeVersion": 4.2,
          "alwaysOutputData": false
        },
        {
          "id": "6ae404a1-e3c1-4f12-9b05-277fbf811205",
          "name": "sendLinkedinConnection",
          "type": "n8n-nodes-base.httpRequest",
          "onError": "continueRegularOutput",
          "position": [
            -192,
            384
          ],
          "parameters": {
            "url": "https://    /api/v1/users/invite",
            "method": "POST",
            "options": {},
            "sendBody": true,
            "sendHeaders": true,
            "bodyParameters": {
              "parameters": [
                {
                  "name": "provider_id",
                  "value": "={{ $json.provider_id }}"
                },
                {
                  "name": "account_id",
                  "value": "=hug"
                }
              ]
            },
            "headerParameters": {
              "parameters": [
                {
                  "name": "accept",
                  "value": "application/json"
                },
                {
                  "name": "X-API-KEY",
                  "value": "cyJgUBYI./mouYKWE="
                },
                {}
              ]
            }
          },
          "typeVersion": 4.2
        },
        {
          "id": "9b1bcaed-164b-4ddc-9793-7d70943e7c32",
          "name": "Sticky Note3",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -864,
            272
          ],
          "parameters": {
            "color": 6,
            "width": 220,
            "height": 260,
            "content": "Using the linkedin username, retrieve the provider id needed to send a connection request"
          },
          "typeVersion": 1
        },
        {
          "id": "5f97bf54-cd9e-4c02-81c8-2652ac2a508b",
          "name": "Sticky Note4",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -464,
            272
          ],
          "parameters": {
            "color": 2,
            "width": 220,
            "height": 260,
            "content": "## Send connection request"
          },
          "typeVersion": 1
        },
        {
          "id": "aa62a8ab-6160-4394-97c9-9f65b5bb8cd8",
          "name": "Sticky Note5",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -32,
            272
          ],
          "parameters": {
            "width": 180,
            "height": 260,
            "content": "## Track request sent"
          },
          "typeVersion": 1
        },
        {
          "id": "7755e26a-3175-4053-86da-178b159f18d3",
          "name": "Schedule Trigger",
          "type": "n8n-nodes-base.scheduleTrigger",
          "position": [
            -2240,
            304
          ],
          "parameters": {
            "rule": {
              "interval": [
                {
                  "triggerAtHour": 13,
                  "triggerAtMinute": 19
                }
              ]
            }
          },
          "typeVersion": 1.2
        },
        {
          "id": "177bfff7-2347-4bf2-9210-3d5e12ecee20",
          "name": "Google Sheets1",
          "type": "n8n-nodes-base.googleSheets",
          "position": [
            -2048,
            304
          ],
          "parameters": {
            "options": {},
            "sheetName": {
              "__rl": true,
              "mode": "list",
              "value": "gid=0",
              "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1RN7JW0aGmAoJ3PI9AukbtAMUIV08nyKk93ti0J72s9g/edit#gid=0",
              "cachedResultName": "Sheet1"
            },
            "documentId": {
              "__rl": true,
              "mode": "list",
              "value": "1RN7JW0aGmAoJ3PI9AukbtAMUIV08nyKk93ti0J72s9g",
              "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1RN7JW0aGmAoJ3PI9AukbtAMUIV08nyKk93ti0J72s9g/edit?usp=drivesdk",
              "cachedResultName": "Linkedin profile scarper "
            }
          },
          "typeVersion": 4.5
        },
        {
          "id": "9236e354-8305-40d2-b269-567b760ab280",
          "name": "Limit",
          "type": "n8n-nodes-base.limit",
          "position": [
            -1536,
            304
          ],
          "parameters": {
            "maxItems": 14
          },
          "typeVersion": 1
        },
        {
          "id": "ef4cfe8e-ef34-4fb8-b3df-ff4928c9d6ca",
          "name": "If",
          "type": "n8n-nodes-base.if",
          "position": [
            -368,
            96
          ],
          "parameters": {
            "options": {},
            "conditions": {
              "options": {
                "version": 2,
                "leftValue": "",
                "caseSensitive": true,
                "typeValidation": "loose"
              },
              "combinator": "and",
              "conditions": [
                {
                  "id": "e128a92c-da2f-4ce5-bcce-9fd4ed35b05c",
                  "operator": {
                    "type": "string",
                    "operation": "contains"
                  },
                  "leftValue": "={{ $json.error }}",
                  "rightValue": "error"
                }
              ]
            },
            "looseTypeValidation": true
          },
          "typeVersion": 2.2
        },
        {
          "id": "86824b84-474f-4654-812c-8ebd91882cb5",
          "name": "Google Sheets2",
          "type": "n8n-nodes-base.googleSheets",
          "position": [
            48,
            64
          ],
          "parameters": {
            "columns": {
              "value": {
                "Linkedin Url": "={{ $('Loop Over Items').item.json['Linkedin Url'] }}",
                "Connection sent": "={{ $json.error.code }}"
              },
              "schema": [
                {
                  "id": "Linkedin Url",
                  "type": "string",
                  "display": true,
                  "removed": false,
                  "required": false,
                  "displayName": "Linkedin Url",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "Title",
                  "type": "string",
                  "display": true,
                  "removed": true,
                  "required": false,
                  "displayName": "Title",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "Connection sent",
                  "type": "string",
                  "display": true,
                  "removed": false,
                  "required": false,
                  "displayName": "Connection sent",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "first_name",
                  "type": "string",
                  "display": true,
                  "removed": true,
                  "required": false,
                  "displayName": "first_name",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "last_name",
                  "type": "string",
                  "display": true,
                  "removed": true,
                  "required": false,
                  "displayName": "last_name",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "locations",
                  "type": "string",
                  "display": true,
                  "removed": true,
                  "required": false,
                  "displayName": "locations",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "company",
                  "type": "string",
                  "display": true,
                  "removed": true,
                  "required": false,
                  "displayName": "company",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "positions",
                  "type": "string",
                  "display": true,
                  "removed": true,
                  "required": false,
                  "displayName": "positions",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "provider_id",
                  "type": "string",
                  "display": true,
                  "removed": true,
                  "required": false,
                  "displayName": "provider_id",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "row_number",
                  "type": "number",
                  "display": true,
                  "removed": true,
                  "readOnly": true,
                  "required": false,
                  "displayName": "row_number",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                }
              ],
              "mappingMode": "defineBelow",
              "matchingColumns": [
                "Linkedin Url"
              ],
              "attemptToConvertTypes": false,
              "convertFieldsToString": false
            },
            "options": {},
            "operation": "update",
            "sheetName": {
              "__rl": true,
              "mode": "list",
              "value": "gid=0",
              "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1RN7JW0aGmAoJ3PI9AukbtAMUIV08nyKk93ti0J72s9g/edit#gid=0",
              "cachedResultName": "Sheet1"
            },
            "documentId": {
              "__rl": true,
              "mode": "list",
              "value": "1RN7JW0aGmAoJ3PI9AukbtAMUIV08nyKk93ti0J72s9g",
              "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1RN7JW0aGmAoJ3PI9AukbtAMUIV08nyKk93ti0J72s9g/edit?usp=drivesdk",
              "cachedResultName": "Linkedin profile scarper "
            }
          },
          "typeVersion": 4.5
        },
        {
          "id": "9af0e84a-5d21-4a46-b46c-58961ee38d09",
          "name": "Sticky Note6",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            -496,
            48
          ],
          "parameters": {
            "width": 512,
            "content": "## Error \nskip that url"
          },
          "typeVersion": 1
        }
      ],
      "active": false,
      "pinData": {},
      "settings": {
        "executionOrder": "v1"
      },
      "versionId": "86cc359c-dc16-4009-9559-b089a8cf9096",
      "connections": {
        "If": {
          "main": [
            [
              {
                "node": "sendLinkedinConnection",
                "type": "main",
                "index": 0
              }
            ],
            [
              {
                "node": "Google Sheets2",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Code": {
          "main": [
            [
              {
                "node": "Edit Fields",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Wait": {
          "main": [
            [
              {
                "node": "Google Sheets",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Limit": {
          "main": [
            [
              {
                "node": "Code",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Filter": {
          "main": [
            [
              {
                "node": "Limit",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Edit Fields": {
          "main": [
            [
              {
                "node": "Loop Over Items",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Google Sheets": {
          "main": [
            [
              {
                "node": "Loop Over Items",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Google Sheets1": {
          "main": [
            [
              {
                "node": "Filter",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Google Sheets2": {
          "main": [
            [
              {
                "node": "Loop Over Items",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Loop Over Items": {
          "main": [
            [],
            [
              {
                "node": "getLinkedinUser",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "getLinkedinUser": {
          "main": [
            [
              {
                "node": "If",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Schedule Trigger": {
          "main": [
            [
              {
                "node": "Google Sheets1",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "sendLinkedinConnection": {
          "main": [
            [
              {
                "node": "Wait",
                "type": "main",
                "index": 0
              }
            ]
          ]
        }
      }
    }