{
  "id": "cW3lbH2MV3Cqv895",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "CREATOR - Invite people who visited my profile",
  "tags": [],
  "nodes": [
    {
      "id": "9c6ae4e3-aa16-4ed0-8120-b6a9a3b44bc1",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -304,
        160
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "af82f238-a076-4981-a071-beeb340c51ad",
      "name": "Import users who viewed your profile",
      "type": "n8n-nodes-sourcegeek.sourcegeek",
      "position": [
        -80,
        160
      ],
      "parameters": {
        "operation": "importProfileViewers",
        "maxResults": 5
      },
      "credentials": {
        "sourcegeekCredentialsApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6faffe87-5bf7-4cb5-a2f3-4b7c71097188",
      "name": "Check connection status with a profile",
      "type": "n8n-nodes-sourcegeek.sourcegeek",
      "position": [
        576,
        32
      ],
      "parameters": {
        "operation": "checkConnectionStatus",
        "linkedinUrl": "=https://www.linkedin.com/in/{{ $json.linkedinUsername }}/"
      },
      "credentials": {
        "sourcegeekCredentialsApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d94d0271-1410-465a-a1d7-1df7fa02aa21",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        144,
        160
      ],
      "parameters": {
        "jsCode": "// Get the contacts array from the first input item\nconst contacts = items[0].json.data.contacts;\n\n// Map each contact into the standard n8n format: { json: { ...Data... } }\nreturn contacts.map(contact => {\n  return {\n    json: contact\n  };\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "d27a9012-f234-46f3-a5e7-42f10a4cc9e6",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        800,
        32
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "ae18a77d-caa7-4dbb-a4c0-5415b57be9a6",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.data.status }}",
                    "rightValue": "NOT_CONNECTED"
                  }
                ]
              }
            },
            {
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "9d8950d3-0ab2-437a-84e6-2c8c30465bad",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.data.status }}",
                    "rightValue": "CONNECTED"
                  }
                ]
              }
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.4
    },
    {
      "id": "d1cc3bcf-93c9-4dcb-a2da-6329757f6dd1",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        368,
        160
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "838af6ff-9a17-41a1-ad13-3bc2002b38b3",
      "name": "Send connection request",
      "type": "n8n-nodes-sourcegeek.sourcegeek",
      "position": [
        1024,
        96
      ],
      "parameters": {
        "operation": "sendConnectionRequest",
        "linkedinUrl": "=https://www.linkedin.com/in/{{ $json.linkedinUsername }}/",
        "connectionNote": "Thank you for watching my profile. Shall we connect?"
      },
      "credentials": {
        "sourcegeekCredentialsApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1a29dd54-d638-4861-8b8c-624319ab4431",
      "name": "Send message",
      "type": "n8n-nodes-sourcegeek.sourcegeek",
      "position": [
        1024,
        304
      ],
      "parameters": {
        "message": "Thank you for watching my profile. How can I help you?",
        "operation": "sendMessage",
        "linkedinUrl": "=https://www.linkedin.com/in/{{ $json.linkedinUsername }}/"
      },
      "credentials": {
        "sourcegeekCredentialsApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "aa966ea3-3e5f-44da-919a-9789cc53eb81",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        -80
      ],
      "parameters": {
        "color": 7,
        "width": 1600,
        "height": 592,
        "content": "## Outreach on people who watched your profile\n"
      },
      "typeVersion": 1
    },
    {
      "id": "d649425a-5ae8-4b30-8a4e-eea3d34a0f5c",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -656,
        -80
      ],
      "parameters": {
        "width": 272,
        "height": 592,
        "content": "## How it works\nThis workflow can be used to take action on people who watched your profile on LinkedIn.\n\nIt check the last 10 people who watched your profile. Those people are placed in an array and the workflow will loop through the array.\n\nWithin the loop the Connection Status will be checked with the user who watched your profile.\n\nIf the user is a 1st degree connection, a long direct message can be send.\n\nIf the user is a 2nd degree connection, a Connection Request can be send, including a note."
      },
      "typeVersion": 1
    },
    {
      "id": "60e267a9-65fe-44ee-83f9-a90cdd0e9df1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        16
      ],
      "parameters": {
        "color": 5,
        "width": 160,
        "height": 128,
        "content": "Retrieve the last 10 users who watched your profile on LinkedIn"
      },
      "typeVersion": 1
    },
    {
      "id": "4bb83454-4e6f-45d8-ba47-76eb7a4ddad0",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        -64
      ],
      "parameters": {
        "color": 5,
        "width": 150,
        "height": 80,
        "content": "Check Connection Status with profile"
      },
      "typeVersion": 1
    },
    {
      "id": "d4c92dcd-74be-4c9a-94ec-bfa9aed4fd97",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        -48
      ],
      "parameters": {
        "color": 5,
        "width": 166,
        "height": 96,
        "content": "Send Connection Request or Direct Message, based on Connection Status"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "29eb9720-1fca-4bf2-8fec-c9def261a2a3",
  "connections": {
    "Switch": {
      "main": [
        [
          {
            "node": "Send connection request",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send message": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Check connection status with a profile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send connection request": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Import users who viewed your profile": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Import users who viewed your profile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check connection status with a profile": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}