{
  "name": "Invite the people who reacted to a LinkedIn post with HeyReagent",
  "nodes": [
    {
      "id": "90491656-3a7e-4706-94fa-05b347bd28df",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -40,
        -720
      ],
      "parameters": {
        "width": 760,
        "height": 660,
        "content": "## Invite the people who reacted to a LinkedIn post\n\nPaste the link of a LinkedIn post, yours or anyone's, and send a connection invitation with your note to the people who reacted to it. People who react to a post on your subject are already warm. It runs on your own LinkedIn account through HeyReagent's API: n8n's own LinkedIn node can only create posts.\n\n### How it works\n1. **Which post** holds the link of the post, how many people (up to 100) and the note.\n2. **Get who reacted** reads the post. The answer lists who reacted and who commented.\n3. **One person per item** turns the list of people who reacted into one item each. For the people who commented instead, change `result.reactors` to `result.commenters`.\n4. **Send invitation** sends one invitation per person, a few seconds apart.\n\n### Set up (about 5 minutes)\n1. Sign in at heyreagent.com and connect your own LinkedIn account on the page you land on.\n2. Open Menu, then Developers, and create a key. Copy it: it is shown once.\n3. In n8n, open each **HTTP Request** node, and under **Bearer Auth** create a credential with that key. Use the same credential in both nodes.\n4. Change the values in the **Which post** node, then press **Execute workflow**.\n\n### Good to know\n- Each LinkedIn account has daily limits (80 invitations a day). A call past a limit answers `ok: false` with the time it resets; the workflow carries on and shows it.\n- Every call answers `{ \"ok\": true, \"result\": { … } }` or `{ \"ok\": false, \"error\": \"…\", \"message\": \"…\" }`.\n- On the free plan LinkedIn is disconnected after a while without use, so run it while you work. A scheduled run needs the Connect plan.\n- HeyReagent is not affiliated with LinkedIn. LinkedIn's User Agreement does not allow automated activity and it can restrict an account: keep the numbers small.\n- All actions: https://heyreagent.com/docs"
      }
    },
    {
      "id": "1b5177d9-5f70-49f8-8a39-7a7745c8ad18",
      "name": "Change these",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        160,
        -210
      ],
      "parameters": {
        "width": 240,
        "height": 190,
        "content": "### Change these\nThe link of the post, how many people, and the note. On LinkedIn, click the More icon (the three dots) at the top right of the post, then \"Copy link to post\"."
      }
    },
    {
      "id": "1e9f94f0-3f08-437f-a10e-54f5ac3d900f",
      "name": "Your key goes here",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        400,
        170
      ],
      "parameters": {
        "width": 640,
        "height": 100,
        "content": "### Your key goes here\nBoth HTTP Request nodes use one **Bearer Auth** credential: your HeyReagent key."
      }
    },
    {
      "id": "dd18d5d7-aae4-444c-8d4a-d624be7ef724",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "parameters": {}
    },
    {
      "id": "8e53730a-fd8b-4151-9db6-dc9b6050cf3a",
      "name": "Which post",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        220,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "7fd0e120-fae2-4680-a4a6-104866d57ed1",
              "name": "postUrl",
              "type": "string",
              "value": "PASTE_POST_LINK_HERE"
            },
            {
              "id": "37d6ce68-e818-41f1-ba53-c3299b8b7302",
              "name": "howMany",
              "type": "number",
              "value": 10
            },
            {
              "id": "07e75f5f-a6b7-426c-bb45-14570bbb1474",
              "name": "note",
              "type": "string",
              "value": "Thanks for reacting to my post. I would like to connect."
            }
          ]
        }
      }
    },
    {
      "id": "5835304b-f35c-40e7-b7c0-035de914d23f",
      "name": "Get who reacted",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        440,
        0
      ],
      "onError": "continueRegularOutput",
      "parameters": {
        "method": "POST",
        "url": "https://api.heyreagent.com/v1/actions/get_post_engagers",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ postUrl: $json.postUrl, maxReactions: $json.howMany }) }}",
        "options": {}
      }
    },
    {
      "id": "cf61bf7e-901f-420d-b66a-f247a377f109",
      "name": "One person per item",
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        660,
        0
      ],
      "parameters": {
        "fieldToSplitOut": "result.reactors",
        "options": {}
      }
    },
    {
      "id": "32878f65-1fdc-49df-ae0d-93b9fd2df8f0",
      "name": "Send invitation",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        880,
        0
      ],
      "onError": "continueRegularOutput",
      "parameters": {
        "method": "POST",
        "url": "https://api.heyreagent.com/v1/actions/send_invitation",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ profileUrl: $json.linkedinUrl, note: $('Which post').first().json.note }) }}",
        "options": {
          "batching": {
            "batch": {
              "batchSize": 1,
              "batchInterval": 4000
            }
          }
        }
      }
    }
  ],
  "connections": {
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Which post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Which post": {
      "main": [
        [
          {
            "node": "Get who reacted",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get who reacted": {
      "main": [
        [
          {
            "node": "One person per item",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "One person per item": {
      "main": [
        [
          {
            "node": "Send invitation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {}
}