{
  "name": "LinkedIn auto message router and responder with request detection",
  "nodes": [
    {
      "id": "5f71a0e6-d5ec-4712-9feb-2b10a1b0a3ea",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        0,
        0
      ]
    },
    {
      "id": "bd66537c-6fe5-4877-9127-3b78af08c499",
      "name": "Check if from me",
      "type": "n8n-nodes-base.if",
      "position": [
        440,
        0
      ]
    },
    {
      "id": "e14aedab-47e9-4811-b991-ee0d00290c39",
      "name": "Response, No action",
      "type": "n8n-nodes-base.noOp",
      "position": [
        700,
        120
      ]
    },
    {
      "id": "8adbb07e-4897-4421-b581-c963b754aa2b",
      "name": "New Message",
      "type": "n8n-nodes-base.noOp",
      "position": [
        680,
        -140
      ]
    },
    {
      "id": "39865ae2-a266-47ba-a6fd-c9b1f5d5a931",
      "name": "Global Variables",
      "type": "n8n-nodes-base.set",
      "position": [
        220,
        0
      ]
    },
    {
      "id": "3c58401c-cb83-4d71-9469-7563d6ce9c16",
      "name": "Slack Button Press",
      "type": "n8n-nodes-base.webhook",
      "position": [
        0,
        800
      ]
    },
    {
      "id": "b87d4806-423b-4656-bbd6-9d0808242cc4",
      "name": "Parse Webhook",
      "type": "n8n-nodes-base.set",
      "position": [
        480,
        800
      ]
    },
    {
      "id": "ee147347-1a88-4e96-9580-d08285e901c0",
      "name": "Verify Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        240,
        800
      ]
    },
    {
      "id": "ac2cb5e1-394a-4a5c-a999-a56d315bc3ff",
      "name": "Check if approved",
      "type": "n8n-nodes-base.if",
      "position": [
        1140,
        580
      ]
    },
    {
      "id": "3812b521-2e15-4c24-9883-79ef04fc6cb3",
      "name": "Send User Message",
      "type": "n8n-nodes-base.slack",
      "position": [
        4080,
        -100
      ]
    },
    {
      "id": "7470b927-8a4d-4421-b6d3-cc55623d77dd",
      "name": "Send Org Message",
      "type": "n8n-nodes-base.slack",
      "position": [
        4080,
        60
      ]
    },
    {
      "id": "0c63c0e7-752d-4bd7-ab78-23a1ff4d70ae",
      "name": "Send Nothing Found Message",
      "type": "n8n-nodes-base.slack",
      "position": [
        4080,
        220
      ]
    },
    {
      "id": "fb29432d-7603-4b42-902f-7784459dd40d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -420
      ],
      "parameters": {
        "width": 980,
        "height": 720,
        "content": "![unipile](https://uploads.n8n.io/templates/unipile.png)\n## LinkedIn Message Processing\nReceives the LinkedIn message via Unipile api webhook."
      }
    },
    {
      "id": "388d621c-7339-4d74-a2c4-4da9c41a441f",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        320
      ],
      "parameters": {
        "width": 2097,
        "height": 693,
        "content": "![Slack](https://uploads.n8n.io/templates/slack.png)\n## Slack Bot Button Press\nThis workflow gets the button presses from the Slack interface and passes it along to Unipile for processing."
      }
    },
    {
      "id": "13ed0034-df98-46a8-931c-4e87667e624c",
      "name": "Decide on Message Type",
      "type": "n8n-nodes-base.switch",
      "position": [
        3760,
        -80
      ]
    },
    {
      "id": "e4c36cc2-9ad1-4ceb-8698-05079c9c6509",
      "name": "User Switcher",
      "type": "n8n-nodes-base.switch",
      "position": [
        680,
        800
      ]
    },
    {
      "id": "f84186be-8ded-47c5-8bdb-9366c8be59fa",
      "name": "Isolate Message and Payload",
      "type": "n8n-nodes-base.set",
      "position": [
        920,
        580
      ]
    },
    {
      "id": "7dc03482-8c14-4494-a475-3f958a1fd445",
      "name": "Isolate Payload",
      "type": "n8n-nodes-base.set",
      "position": [
        920,
        820
      ]
    },
    {
      "id": "425b2b79-447d-4736-9edf-0033969d64b4",
      "name": "Send webhook to Coworker Workflow",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1140,
        820
      ]
    },
    {
      "id": "4c36fc5c-75a5-4279-9555-13fdfa033510",
      "name": "Send Message to LinkedIn via Unipile",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1380,
        520
      ]
    },
    {
      "id": "bed8608b-b474-4472-87ad-1e3454799a81",
      "name": "Delete Approved Message from Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1680,
        520
      ]
    },
    {
      "id": "b79429a6-3b46-4898-a933-3b6ec77a1f97",
      "name": "Delete Denied Message from Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1680,
        720
      ]
    },
    {
      "id": "9a475e01-a250-44f2-8cc6-4ef60aedaa36",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3220,
        -80
      ]
    },
    {
      "id": "53011c4c-b9aa-4b47-84c8-060e4b7a2db9",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        3340,
        160
      ]
    },
    {
      "id": "b5eb7520-c887-4a72-89d0-d616c24fdfca",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        3120,
        180
      ]
    },
    {
      "id": "b405f410-4d76-43f9-b21c-b6cb363daa43",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        3500,
        160
      ]
    },
    {
      "id": "8ad9d20b-07a4-46f2-9dbb-5d3d8d502641",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3020,
        -400
      ],
      "parameters": {
        "width": 668,
        "height": 718,
        "content": "![hctiapi](https://uploads.n8n.io/templates/openai.png)\n## Generate Automated response\nThe AI bot receives not only the message from LinkedIn, but also LinkedIn user context, such as the number of fol"
      }
    },
    {
      "id": "8d593035-111a-45dc-93ea-950aad7b0ebb",
      "name": "Isolate parent workflow data for AI",
      "type": "n8n-nodes-base.set",
      "position": [
        2260,
        20
      ]
    },
    {
      "id": "d267a541-a739-49b8-a2f6-b8afbb6cc837",
      "name": "Get Request Router Directory Database",
      "type": "n8n-nodes-base.notion",
      "position": [
        2460,
        20
      ]
    },
    {
      "id": "af762a13-5774-4608-a221-7860dce3f27c",
      "name": "Format DB data for AI Context",
      "type": "n8n-nodes-base.set",
      "position": [
        2660,
        20
      ]
    },
    {
      "id": "88da9528-2a4c-426a-bd27-8caa47bed3f5",
      "name": "Aggregate DB objects into one item",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2860,
        20
      ]
    },
    {
      "id": "204ce89b-9443-4ece-8385-cb3b59bd5a0b",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2180,
        -400
      ],
      "parameters": {
        "width": 826,
        "height": 700,
        "content": "![notion](https://uploads.n8n.io/templates/notionlogo.png)\n## Get routing Database data\nAn AI bot that does not get smarter over time is not a useful bot. That is why this bot references a shared inte"
      }
    },
    {
      "id": "d4a894d6-334b-4abe-9d1a-0e449da46b6f",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        920,
        -540
      ],
      "parameters": {
        "width": 1246,
        "height": 840,
        "content": "![Linkedin](https://uploads.n8n.io/templates/linkedinlogo.png))\n## Enrich LinkedIn Data with User or Org Data from Unipile\nLinkedIn messages arrive from one of two object types, users or organizations"
      }
    },
    {
      "id": "ec186db1-e7e8-480e-a94a-d4c1de5ee420",
      "name": "Get Linkedin User Data from Unipile",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        980,
        -140
      ]
    },
    {
      "id": "d3fb953a-f3cf-4005-934c-b091bb784d84",
      "name": "Set User Data from Unipile",
      "type": "n8n-nodes-base.set",
      "position": [
        1240,
        -280
      ]
    },
    {
      "id": "c6077ddb-362d-45f4-a497-2529348148ab",
      "name": "Group in one object - User",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1420,
        -280
      ]
    },
    {
      "id": "1eb09bf7-fb93-4c19-bc41-86330c7b33e6",
      "name": "Get Linkedin Org Data from Unipile",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1240,
        80
      ]
    },
    {
      "id": "38f5ed6f-9302-4979-b964-c1d231a344b6",
      "name": "Set Linkedin Org Data from Unipile",
      "type": "n8n-nodes-base.set",
      "position": [
        1520,
        -80
      ]
    },
    {
      "id": "45bd4b50-01e6-468b-815a-58073c137693",
      "name": "Group in one object - Org",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1720,
        -80
      ]
    },
    {
      "id": "c97c50b6-b491-43cd-8eb6-e48b368c862e",
      "name": "Set unable to find data object",
      "type": "n8n-nodes-base.set",
      "position": [
        1640,
        120
      ]
    },
    {
      "id": "b42b967a-b127-458c-94b6-7a81052e6ba1",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3700,
        -400
      ],
      "parameters": {
        "width": 857,
        "height": 813,
        "content": "![Slack](https://uploads.n8n.io/templates/slack.png)\n## Slack Bot Button Press\nThis workflow gets the button presses from the Slack interface and passes it along to Unipile for processing."
      }
    },
    {
      "id": "48da88b3-beac-4c52-bf0c-460bc4d525fb",
      "name": "Set all potential Inputs",
      "type": "n8n-nodes-base.set",
      "position": [
        2020,
        -80
      ]
    },
    {
      "id": "7e091689-7905-4101-8dc9-0609b4f80233",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        -180
      ],
      "parameters": {
        "width": null,
        "height": 360,
        "content": "#### Add me to Unipile Webhook Dashboard\nEnsure that you have created a webhook in the Unipile dashboard that links to this node. [Link to Webhook Dashboard](https://dashboard.unipile.com/webhooks)"
      }
    },
    {
      "id": "97da9488-0e37-42c0-8dbf-912731fc5091",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        540
      ],
      "parameters": {
        "width": null,
        "height": 420,
        "content": "#### Add me to your Slack App Interactivity and Shortcuts\nTo receive button presses in this webhook, ensure that you've created a slack app and then set the webhook URL in the Interactivity & Shortcut"
      }
    },
    {
      "id": "c9be1dca-da24-4f18-b2a4-36f89b7520a1",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        940,
        -300
      ],
      "parameters": {
        "width": 180,
        "height": 320,
        "content": "#### Update Credentials\nEnsure to use generic header auth. The name for the header is X-API-KEY. [Link to access token page on Unipile Site](https://dashboard.unipile.com/access-tokens)"
      }
    },
    {
      "id": "6e81a9bf-1c50-4366-9bae-be6241fc7875",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        -80
      ],
      "parameters": {
        "width": 180,
        "height": 320,
        "content": "#### Update Credentials\nEnsure to use generic header auth. The name for the header is X-API-KEY. [Link to access token page on Unipile Site](https://dashboard.unipile.com/access-tokens)"
      }
    },
    {
      "id": "d8d5d5d1-6fe4-4f03-95cb-4d3cb6182f59",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2400,
        -80
      ],
      "parameters": {
        "width": 220,
        "height": 280,
        "content": "#### Update Credentials\nDoes not have to be notion, can be any database type node like Google sheets. "
      }
    },
    {
      "id": "6a8202e9-e3c0-48db-b894-a009d801bddd",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        -180
      ],
      "parameters": {
        "width": 220,
        "height": 340,
        "content": "#### Update with your Unipile UserID\nEasiest way to do this is to send a message to someone so it triggers this workflow and then copy the senderID that shows in this node"
      }
    },
    {
      "id": "36b271d3-53f6-4548-bf3f-8dea39e05b05",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3060,
        60
      ],
      "parameters": {
        "width": 220,
        "height": 240,
        "content": "#### Update Credentials"
      }
    },
    {
      "id": "2391f630-e071-4720-81c8-7937452e0523",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4020,
        -160
      ],
      "parameters": {
        "width": 220,
        "height": 560,
        "content": "#### Update Credentials"
      }
    },
    {
      "id": "c533f8ea-1391-4b2f-81ba-2caa8a919e3b",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1320,
        360
      ],
      "parameters": {
        "width": 220,
        "height": 340,
        "content": "#### Update Credentials\nEnsure to use generic header auth. The name for the header is X-API-KEY. [Link to access token page on Unipile Site](https://dashboard.unipile.com/access-tokens)"
      }
    },
    {
      "id": "6f0ef5cc-ef53-4a02-bdd9-5931c9ba8a0e",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1620,
        460
      ],
      "parameters": {
        "width": 220,
        "height": 460,
        "content": "#### Update Credentials"
      }
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Global Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Decide on Message Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Message": {
      "main": [
        [
          {
            "node": "Get Linkedin User Data from Unipile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Webhook": {
      "main": [
        [
          {
            "node": "User Switcher",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "User Switcher": {
      "main": [
        [
          {
            "node": "Isolate Message and Payload",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Isolate Payload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verify Webhook": {
      "main": [
        [
          {
            "node": "Parse Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Isolate Payload": {
      "main": [
        [
          {
            "node": "Send webhook to Coworker Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if from me": {
      "main": [
        [
          {
            "node": "New Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Response, No action",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Global Variables": {
      "main": [
        [
          {
            "node": "Check if from me",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if approved": {
      "main": [
        [
          {
            "node": "Send Message to LinkedIn via Unipile",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Delete Denied Message from Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Slack Button Press": {
      "main": [
        [
          {
            "node": "Verify Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Decide on Message Type": {
      "main": [
        [
          {
            "node": "Send User Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Org Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Nothing Found Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set all potential Inputs": {
      "main": [
        [
          {
            "node": "Isolate parent workflow data for AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Group in one object - Org": {
      "main": [
        [
          {
            "node": "Set all potential Inputs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Group in one object - User": {
      "main": [
        [
          {
            "node": "Set all potential Inputs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set User Data from Unipile": {
      "main": [
        [
          {
            "node": "Group in one object - User",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Isolate Message and Payload": {
      "main": [
        [
          {
            "node": "Check if approved",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format DB data for AI Context": {
      "main": [
        [
          {
            "node": "Aggregate DB objects into one item",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set unable to find data object": {
      "main": [
        [
          {
            "node": "Set all potential Inputs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate DB objects into one item": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Linkedin Org Data from Unipile": {
      "main": [
        [
          {
            "node": "Set Linkedin Org Data from Unipile",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Set unable to find data object",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Linkedin Org Data from Unipile": {
      "main": [
        [
          {
            "node": "Group in one object - Org",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Linkedin User Data from Unipile": {
      "main": [
        [
          {
            "node": "Set User Data from Unipile",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Linkedin Org Data from Unipile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Isolate parent workflow data for AI": {
      "main": [
        [
          {
            "node": "Get Request Router Directory Database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Message to LinkedIn via Unipile": {
      "main": [
        [
          {
            "node": "Delete Approved Message from Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Request Router Directory Database": {
      "main": [
        [
          {
            "node": "Format DB data for AI Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}