AutomationFlowsAI & RAG › Automate Linkedin Engagement with Gpt-4o Sentiment Analysis & Smart Comments

Automate Linkedin Engagement with Gpt-4o Sentiment Analysis & Smart Comments

ByPunit @punitkumar on n8n.io

Automatically find, analyze, and engage with relevant LinkedIn posts using AI-powered sentiment analysis and comment generation

Event trigger★★★★☆ complexityAI-powered29 nodesHTTP RequestChain LlmOpenRouter ChatOutput Parser StructuredAgentSentiment AnalysisGoogle SheetsTelegram
AI & RAG Trigger: Event Nodes: 29 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #9385 — we link there as the canonical source.

This workflow follows the Agent → Chainllm recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "My workflow 3",
  "tags": [],
  "nodes": [
    {
      "id": "2d0c37d7-9ff9-40d8-8832-7e9f2a25c22d",
      "name": "Search LinkedIn Posts",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1760,
        768
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "96b093e1-5fa4-47b1-895f-010c658c48cb",
      "name": "Extract Posts from Results",
      "type": "n8n-nodes-base.code",
      "position": [
        -1536,
        768
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "95326395-fc44-47ea-9151-b97492b45fd0",
      "name": "Filter Recent Posts",
      "type": "n8n-nodes-base.code",
      "position": [
        -1312,
        768
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "39709765-f45c-423a-88e7-ecb3529d69de",
      "name": "Count Post Characters",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -1088,
        768
      ],
      "parameters": {},
      "typeVersion": 1.7
    },
    {
      "id": "711399e1-52da-49bc-831c-12c15b1474f3",
      "name": "Filter Long Non-Reposts",
      "type": "n8n-nodes-base.if",
      "onError": "continueRegularOutput",
      "position": [
        -736,
        768
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "afc48d7d-7f45-468c-b6ef-faa157606a29",
      "name": "Character Count LLM Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -1088,
        992
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "882170d3-3e8d-47c1-b43a-bad23e6b16b7",
      "name": "Parse Character Count",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -960,
        992
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "0b736782-69c0-4c51-a91e-51f49783ad0e",
      "name": "Generate AI Comment",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        288,
        128
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "d49f3040-d935-4458-80b8-6abc26514563",
      "name": "Analyze Post Sentiment",
      "type": "@n8n/n8n-nodes-langchain.sentimentAnalysis",
      "position": [
        -64,
        384
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "3c7c8092-0e3f-4263-9860-f015aaeb8cb3",
      "name": "Add Reaction to Post",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1088,
        144
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "23b512ed-af04-476a-b7e0-23cd50e71aa4",
      "name": "Process Posts in Batches",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -288,
        768
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "40e67382-64cf-499d-b455-7109d3a22be6",
      "name": "Log Post to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -512,
        768
      ],
      "parameters": {},
      "typeVersion": 4.6
    },
    {
      "id": "e381835c-93b4-49e0-860a-49aaba957b92",
      "name": "Update Sentiment Results",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        352,
        528
      ],
      "parameters": {},
      "typeVersion": 4.6
    },
    {
      "id": "2fb561cb-4ef8-4266-90a6-e0bef3d6c48e",
      "name": "Update Comment Results",
      "type": "n8n-nodes-base.googleSheets",
      "maxTries": 5,
      "position": [
        1536,
        544
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 4.6,
      "waitBetweenTries": 5000
    },
    {
      "id": "84e8d4fa-c515-4a41-b649-4653977ce6ea",
      "name": "Post AI Comment",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "position": [
        864,
        240
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "189456c9-bcc3-4d9e-bae3-931ec6b58c41",
      "name": "Log Error Results",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1312,
        384
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 4.6,
      "waitBetweenTries": 5000
    },
    {
      "id": "047f30a4-cbdf-4d4a-9b81-c45571364484",
      "name": "Wait Before Next Action",
      "type": "n8n-nodes-base.wait",
      "position": [
        1312,
        144
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "c3abad94-6389-4187-abae-7178d4755905",
      "name": "Wait Before Error Logging",
      "type": "n8n-nodes-base.wait",
      "position": [
        1088,
        384
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "ea2746ee-4450-454c-9e5e-dfb12712f7ff",
      "name": "Sentiment Analysis LLM Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        16,
        768
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "ba645178-08fb-4216-8dac-984127585c9e",
      "name": "Comment Generation LLM Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        368,
        352
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9c5389d1-25f1-49db-a137-9a1536091674",
      "name": "Send Completion Notification",
      "type": "n8n-nodes-base.telegram",
      "disabled": true,
      "position": [
        0,
        0
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 1.2
    },
    {
      "id": "79e71bce-1d35-478d-afad-61c8fdbcd576",
      "name": "Get Post Details",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        640,
        240
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "c6f59c47-cf16-4846-add7-ac62944f7afa",
      "name": "Manual Workflow Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1984,
        768
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "4b896861-622f-4261-8ebe-67ea3b2c90ed",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1888,
        288
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "ee726a9c-dbda-4e8d-9ed1-d6bb93a9cc58",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1216,
        288
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "3c50e4b7-d5ac-4abb-b542-29f3e268493a",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -544,
        176
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "3fb952e2-efd5-481f-8d59-36d56459a890",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -176
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "e70d679a-1032-4c2c-bc0a-ddfa7d19a023",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        -144
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "9068e6c2-b37f-4443-98d9-4ad7110b89aa",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1744,
        -160
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "",
  "connections": {
    "Post AI Comment": {
      "main": [
        [
          {
            "node": "Add Reaction to Post",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait Before Error Logging",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Post Details": {
      "main": [
        [
          {
            "node": "Post AI Comment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Error Results": {
      "main": [
        [
          {
            "node": "Process Posts in Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Post to Sheet": {
      "main": [
        [
          {
            "node": "Process Posts in Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Recent Posts": {
      "main": [
        [
          {
            "node": "Count Post Characters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate AI Comment": {
      "main": [
        [
          {
            "node": "Get Post Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Reaction to Post": {
      "main": [
        [
          {
            "node": "Wait Before Next Action",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Count Post Characters": {
      "main": [
        [
          {
            "node": "Filter Long Non-Reposts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Character Count": {
      "ai_outputParser": [
        [
          {
            "node": "Count Post Characters",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Search LinkedIn Posts": {
      "main": [
        [
          {
            "node": "Extract Posts from Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Post Sentiment": {
      "main": [
        [
          {
            "node": "Generate AI Comment",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Sentiment Results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Sentiment Results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Sentiment Results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Sentiment Results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Sentiment Results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Sentiment Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Comment Results": {
      "main": [
        [
          {
            "node": "Process Posts in Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Long Non-Reposts": {
      "main": [
        [
          {
            "node": "Log Post to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Workflow Trigger": {
      "main": [
        [
          {
            "node": "Search LinkedIn Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Next Action": {
      "main": [
        [
          {
            "node": "Update Comment Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Posts in Batches": {
      "main": [
        [
          {
            "node": "Send Completion Notification",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Analyze Post Sentiment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Sentiment Results": {
      "main": [
        [
          {
            "node": "Process Posts in Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Character Count LLM Model": {
      "ai_languageModel": [
        [
          {
            "node": "Count Post Characters",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Error Logging": {
      "main": [
        [
          {
            "node": "Log Error Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Posts from Results": {
      "main": [
        [
          {
            "node": "Filter Recent Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Comment Generation LLM Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate AI Comment",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Sentiment Analysis LLM Model": {
      "ai_languageModel": [
        [
          {
            "node": "Analyze Post Sentiment",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Automatically find, analyze, and engage with relevant LinkedIn posts using AI-powered sentiment analysis and comment generation

Source: https://n8n.io/workflows/9385/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Output Parser Structured, Telegram, N8N Nodes Tesseractjs +14
AI & RAG

Automatically capture, categorize, and log expenses from receipts, PDFs, voice notes, or text — powered by AI and integrated with Telegram and Google Sheets.

HTTP Request, OpenAI, Chain Llm +6
AI & RAG

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

HTTP Request, Google Sheets, OpenRouter Chat +5
AI & RAG

This workflow automates the process of recording financial transactions from photos of receipts or shopping receipts. Users simply send an image of the receipt via Telegram. The image is processed usi

Telegram Trigger, HTTP Request, Chain Llm +7
AI & RAG

Faceless Video. Uses httpRequest, agent, googleDrive, stickyNote. Event-driven trigger; 29 nodes.

HTTP Request, Agent, Google Drive +6