Loading

Step-by-Step Guide

🤖 How to Automatically Generate LinkedIn Comments Using n8n

This guide explains how to set up an automation workflow that:

  • Collects new posts from selected LinkedIn profiles
  • Generates relevant comments using AI
  • Stores all data in Google Sheets
  • Sends the generated comment to Telegram for manual review and posting

This approach helps you engage consistently while keeping full control over what gets published.


Step 1. Import the Ready-Made Workflow into n8n

First, you need to create an account on n8n https://n8n.io/

Then follow these steps:

  1. Click Create Workflow
  2. Open the menu (three dots)
  3. Select Import from File
  4. Upload the provided JSON workflow file

Done. The full automation logic will be loaded.

In n8n, a workflow is an automated process made of connected nodes.

Step 2. Configure the Trigger (Schedule Trigger)

This node controls when the automation runs.

Recommended settings:

  • Trigger type: Schedule
  • Frequency: Every day
  • Time: 07:00

This means the automation will check for new LinkedIn posts daily.

Alternatively, you can use:

  • Manual Trigger — to run the workflow manually when needed

Step 3. Connect Apify to Scrape LinkedIn Posts

This workflow uses Apify to collect posts.

3.1 Configure LinkedIn Post Scraping in Apify

  1. Create an Apify account
  2. Open the LinkedIn Post Scraper actor:
    https://apify.com/supreme_coder/linkedin-post
  3. In the actor settings, add Source URLs.
  4. These are the LinkedIn profile URLs you want to monitor.
  5. Click Save as new task

This creates a reusable scraping task.

3.2 Connect Apify in n8n

In n8n:

  1. Install and open the Apify node
  2. Click Create New Credentials

In Apify:

  • Go to Settings → API & Integrations
  • Copy your Personal API Token

Paste it into n8n credentials.

Then select your created Task

This node will now: → Retrieve the latest posts from selected LinkedIn profiles

Step 4. Retrieve and Filter Posts

Several nodes process the scraped data:

Get Dataset Items (Apify)

This node retrieves all posts from Apify.

Important: Open the node and select your Apify credentials.

Edit Fields

This node structures and formats the data.

IF Node (Filtering)

This node removes irrelevant posts:

  • ❌ reposts
  • ❌ posts without text

Only original text posts move forward.

Step 5. Connect Google Sheets (Data Storage)

Google Sheets acts as your database.

It is used to:

  • Store collected posts
  • Store generated comments
  • Prevent duplicate processing

5.1 Create a Google Sheet

Create a spreadsheet with columns such as:

  • url
  • type
  • firstName
  • lastName
  • occupation
  • timeSincePosted
  • text
  • numLikes
  • numShares
  • numComments
  • postedAt
  • Comment Text

5.2 Connect Google Sheets in n8n

In the node: Get posts from the existing sheet, click: Create New Credentials

Connect your Google account.

Then select:

  • Your document
  • The correct sheet

This allows the workflow to read and write data.

Step 6. Merge Node (Prevent Duplicates)

The Merge node compares:

  • Newly scraped posts
  • Posts already stored in Google Sheets

This ensures:

  • Only new posts are processed.
  • No duplicate comments are generated.

Step 7. Generate Comment Using GPT

The node Generate comment text uses OpenAI GPT.

You can also replace it with any other AI model.

Connect OpenAI

Create new credentials in n8n using your OpenAI API key.

Configure the Prompt

This is the most important part.

Your prompt defines:

  • tone
  • quality
  • positioning

Use your own prompt based on your:

  • personal brand
  • communication style
  • business goals

You can refer to the internal guides we have prepared for you:

Step 8. Save Data to Google Sheets

The next two nodes store all information in your spreadsheet.

This includes:

Data from Apify:

  • url
  • type
  • firstName
  • lastName
  • occupation
  • timeSincePosted
  • text
  • numLikes
  • numShares
  • numComments
  • postedAt

And also:

  • Generated comment text

Important:

Make sure each field is correctly mapped to the proper column.

This sheet becomes your structured engagement database.

Step 9. Send Comment to Telegram for Review

The final node sends the generated comment to Telegram.

You receive:

  • Comment text
  • Post link

This allows you to review and publish manually.

9.1 Create Telegram Bot

Open Telegram. Find: @BotFather

Run:

/start

Then:

/newbot

Choose a name.

You will receive your: Access Token

9.2 Connect Telegram in n8n

Create new Telegram credentials in n8n.

Paste your bot Access Token.

9.3 Get Your Chat ID

Open Telegram. Find: @userinfobot

Run:

/start

Copy your Chat ID.

Paste it into the Telegram node in n8n.

How the Automation Works (Full Overview)

The workflow automatically:

  1. Runs daily
  2. Collects new LinkedIn posts
  3. Filters relevant content
  4. Generates AI comments
  5. Saves everything in Google Sheets
  6. Sends comments to Telegram

Final Result

You will:

  • Never miss important posts
  • Engage consistently
  • Maintain high-quality comments
  • Reduce engagement time by 5x or more

While keeping full control over posting.

This is one of the most effective systems for scaling LinkedIn engagement and building meaningful professional relationships.


Criteria for a Strong LinkedIn Comment

If your responses look like templated politeness or a careful rewording of the author’s idea, you are not strengthening your personal brand. You are dissolving into the feed. LinkedIn is already flooded with phrases like “Great point” and “Completely agree.” These comments are forgettable and they do not create opportunities.

LinkedIn comments are a positioning tool that allows you to:

• strengthen your authority
• build clear associations
• expand your reach
• enter conversations with the right audience

If a comment does not add value to the discussion, it works against your personal brand.

1. Why Standard Prompts Produce Weak Comments

Most people give the model a task that is far too general. When the prompt sounds like:

|Write a comment for this post.

The model will usually:

• restate the author
• agree politely
• avoid taking a position

This happens because the model aims for neutrality and approval by default. It does not know what intellectual task it is supposed to solve, so it chooses the safest possible outcome.

If you want a strong comment, the prompt must define a thinking structure, not just request text generation.

Your prompt must require:

  1. Analysis
  2. A clear position
  3. Added value
  4. A discussion trigger

Without these four elements, the comment will almost certainly be superficial and invisible.

2. The Architecture Of A Strong Prompt

A strong prompt consists of five layers.

Layer 1. Role And Context

The model must understand:

• who it is writing as
• which industry the voice belong to
• what level of expertise is represented

Without this, it will generate generic thoughts that could belong to anyone.

Example formulation:

You are writing as the CEO of a fintech company with hands on experience.

The role creates a filter of interpretation. The same post will be commented on differently by an investor, a marketer, or a product leader.

Layer 2. Mandatory Analytical Step

Strong comments begin with understanding, not text. The prompt must require the model to analyze the post before generating the comment.

Mandatory analytical elements:

• identify the language
• summarize the main idea
• isolate a specific thesis from the author

This forces the model to work with substance rather than surface impressions. The comment becomes precise and intentional.

Layer 3. The Principle Of Added Value

A strong comment does not repeat the post. It does one of the following:

  1. Clarifies
  2. Expands
  3. Challenges
  4. Translates into practical application
  5. Highlights a risk

This is what separates an expert response from simple agreement. If a comment does not introduce a new angle, it does not strengthen your position.

This requirement must be explicitly written into the prompt. If you do not instruct the model to add a new perspective, it will duplicate the author.

Layer 4. Discussion Mechanics

LinkedIn amplifies content that generates conversation. Comments that close the topic do not perform.

A comment must:

• stimulate a response
• create intellectual tension
• encourage the author to continue the thought

It should end with a question or an idea that expands the discussion.

Layer 5. Style Control

Even a strong idea can feel artificial if the text sounds overly polished. To make the comment feel human, you must constrain the model.

The prompt should specify:

• 1 to 3 short sentences
• a conversational tone
• no corporate language
• no repetition
• no special symbols
• slight natural imperfection is allowed

A small amount of roughness makes the text human and distinguishes it from templated AI output.

3. The Logic Of A Strong Comment

A strong comment follows a clear formula:

Author’s context

  • Personal position
  • Additional angle
  • Dialogue

If even one element is missing, the comment is weak.

  • To develop a clear personal position and communication DNA, it is recommended to analyze existing publications if available. Alternatively, conduct a short structured interview using targeted questions, then use an LLM to formulate key messages that will guide future comments.

Comments should be a continuation of strategic communication, not random reactions under viral posts.

A strong comment is a controlled intellectual response built on a clear architecture. And these are the comments that start conversations, attract the right people, and gradually convert into business opportunities.


Prompt Templates

We have already covered the criteria of a strong LinkedIn comment: position, added value, intellectual tension, and dialogue.

Now the question is how to make this systematic.

Below are three levels of templates:

  1. Basic — strict structure.
  2. Strategic — comments rely on a belief system and Key Messages.
  3. Advanced — an additional quality control layer is added.

Template #1. Basic Version

You are — [insert your role]. Your task is to write LinkedIn comments that sound like your personal opinion. Execute the task without any assumptions or deviations: follow every step strictly and sequentially, skip nothing, and add nothing beyond the instructions. Act only as described below.

1. Identify the language of the original post. Use only that language in the comment. Never mix languages or use transliteration.

2.Before writing the comment, explicitly complete three mandatory analytical steps:
- Identify and briefly summarize the main idea of the publication.
- Form your position: connect the selected belief to a specific element of the post and explain the value this perspective adds.

3.Only after completing all steps above, generate the comment while strictly following these format requirements:
- Comment length: 1–3 short sentences.
- Natural, conversational tone. No pathos. No clichés.
- Slight imperfection is allowed.
- End with a meaningful question or idea that extends the discussion.

Absolutely forbidden:
- Using the dash "-" even inside complex sentences;
- Using hashtags (#);
- Using any special symbols (≠, →, ✖︎, ➝);
- Writing in a templated or bureaucratic style.

Action Algorithm (for automation in n8n)

Wait for the publication.

Once the publication appears, complete:
1. Publication language;
2. Main idea summary;
3. Selected belief (number and wording);
4. Justification for the selection;
5. Connection to the publication;
6. Only then generate the comment.

Output Format
Your response must sequentially include:
- Publication language;
- Main idea summary;
- Justification;
- Connection to the publication;
- Comment.

Notes
Under no circumstances skip the analytical stage before writing the comment.
Do not allow templated phrasing, mixed languages, or prohibited symbols.
If the publication is complex or ambiguous, analyze it thoroughly without inventing meaning.

Template #2. Version With Belief System

You are — [insert your role]. Your task is to write LinkedIn comments that sound like your personal opinion. Execute the task strictly and sequentially without assumptions or deviations.

You MUST rely on a predefined belief system.

Belief System (use without modification): [INSERT YOUR NUMBERED BELIEF LIST WITHOUT CHANGES]
1. Identify the language of the original post. Use only that language in your comment.
2. Before writing the comment, explicitly complete three mandatory analytical steps:
3. Identify and briefly summarize the main idea of the publication.
4. Select one belief from the list above that is most relevant (state its number and wording) and explain why it applies.
5. Form your position: connect the selected belief to a specific element of the publication and explain the value this perspective adds.

Only after completing all steps above, generate the comment while strictly following these format requirements:
- 1–3 short sentences.
- Natural, conversational tone. No pathos or clichés.
- Slight imperfection allowed.
- End with a meaningful question or discussion-extending idea.

Absolutely forbidden:
- Using the dash "-";
- Using hashtags (#);
- Using any special symbols;
- Writing in a templated or bureaucratic style.

Action Algorithm (for automation in n8n)

Wait for the publication.
Once the publication appears, complete:
1. Publication language;
2. Main idea summary;
3. Selected belief (number and wording);
4. Justification;
5. Connection to the publication;
6. Only then generate the comment.

Output Format
Your response must sequentially include:
- Publication language;
- Main idea summary;
- Selected belief (number and wording);
- Justification;
- Connection to the publication;
- Comment.

The comment must strictly follow the selected belief and strengthen it within the context of the specific publication.

Examples

Example 1
Publication language: English
Main idea summary: The author believes influencers are not always effective for promoting Web3 projects.
Selected belief: 6. Which approaches do you consider overrated in crypto marketing?
Justification: the selected belief directly concerns overrated tools, which aligns with the author's position.
Connection: personal experience working with influencers is added, along with a question about alternatives.
Comment: I have noticed the same, influencers do not solve everything even though it once felt like a magic pill. We have seen cases where results did not meet expectations. What other channels have you tested beyond influencers?

Example 2
Publication language: English
Main idea summary: The post describes the risks of fast profit chasing in crypto.
Selected belief: 4. Which risks or threats do you consider underestimated in the industry?
Justification: The selected belief focuses on underestimated risks, directly matching the topic.
Connection: personal experience reinforces the warning perspective.
Comment: Totally agree, sometimes people just try to make fast cash and it end not really good. Seen few stories like that myself lol. What in your view helps avoid most of these pitfalls?

Notes

Under no circumstances skip the analytical stage.
Do not use any source of opinion other than the provided belief system.
Avoid templated phrasing, language mixing, or prohibited symbols.
If the publication is complex or ambiguous, analyze it thoroughly without adding assumptions.

Template #3

This template does not generate a comment. It audits a comment created using Template #1 or Template #2.

Why this is necessary:

Even with a strict algorithm, the model may simplify wording, soften the position, or partially repeat the author. The quality control layer detects such weaknesses before publication.

This template can be:

  • executed manually after comment generation;
  • added as a separate node in n8n;
  • used as an automated second layer before publishing.

This makes the system scalable and reliable.

Verification Prompt

Analyze the previously generated comment and answer the following:

1. Does the comment introduce a new idea rather than repeating the author?
2. Is there a clear reference to a specific thesis from the publication?
3. Does the comment strictly rely on the selected belief?
4. Is there dialogue or intellectual tension?
5. Are all formatting rules and prohibitions respected?

If at least one criterion is not met, rewrite the comment without violating the original generation rules.

Output the final version only after all criteria are satisfied.

Back to main page