03 · Social Media Automation

LinkedIn Comment
Reply Bot

Monitors LinkedIn posts for new comments, generates contextually relevant AI replies using OpenRouter, and posts them automatically via Puppeteer — bypassing LinkedIn's missing comments API entirely.

n8n Puppeteer Node.js OpenRouter LLM LinkedIn Schedule Trigger

The Problem

LinkedIn provides no public API for reading or posting comments. Manually replying to every comment on a post wastes hours — and slow responses hurt engagement algorithms.

The Solution

A headless browser (Puppeteer) scrapes comments directly from the DOM, an LLM generates context-aware replies, and the bot posts them — all on a schedule, zero manual effort.

By the numbers

6/6
Comments replied
0s
Manual effort
100%
Automated

How it works

01
Schedule Trigger fires on interval n8n's built-in scheduler kicks off the workflow at a set frequency — no manual runs needed.
02
HTTP Request → OpenRouter LLM The workflow POSTs to OpenRouter's API, sending post context and comment text. The LLM returns a contextually relevant, human-sounding reply.
03
Edit Fields — format the reply payload The AI response is cleaned and structured into the exact format expected by the Puppeteer script — no extra tokens, no wrapper text.
04
Execute Command — run post-replies1.js n8n shells out to Node.js and runs the Puppeteer script. The bot logs in, navigates to the target post, finds unread comments, and types + submits each reply.
05
Completion log: Total · Replied · Pending The terminal confirms the run: Total: 6 | Replied: 6 | Pending: 0. Every comment is accounted for before the process exits.

Screenshots

Want something similar built for your business?

I can adapt this for Twitter/X, Instagram, or any platform with a comments feed.

Hire me on Upwork ↗