🔓 Unlock all 10,000+ workflows & prompts free Join Newsletter →
✅ Full access unlocked — explore all 10,000 AI workflow and prompt templates Browse Templates →
Home n8n Workflow
January 22, 2026

LinkedIn + NocoDB: comment leads logged, no repeats

Lisa Granqvist Partner Workflow Automation Expert

You post something solid on LinkedIn, the comments start rolling in, and then the messy part begins. You’re scrolling, copying profiles, trying to remember who asked for the link, and hoping you don’t DM the same person twice.

Marketing managers feel it when engagement spikes and the follow-up doesn’t. A coach offering a lead magnet in the comments knows the pain too. And if you run an agency, LinkedIn lead logging can turn into a daily “did we reply to everyone?” stress test.

This workflow turns trigger-word comments into clean, tracked leads in NocoDB, then routes the right DM or comment reply based on connection status. You’ll see how it works, what you need, and the common places it can fail (so you can avoid them).

How This Automation Works

The full n8n workflow, from trigger to final output:

n8n Workflow Template: LinkedIn + NocoDB: comment leads logged, no repeats

The Problem: LinkedIn Comments Create Leads… Then Chaos

If you use “comment guide and I’ll send it” or “drop template below” to drive engagement, you already know what happens next. Great post, lots of intent, and then you’re stuck doing manual triage in a LinkedIn comment thread. You open profiles one by one, check if you’re connected, decide whether to DM or reply publicly, and try to track it somewhere (usually a spreadsheet that’s always missing something). After a few posts, you’re no longer nurturing leads. You’re doing admin work with a social network skin on it.

It adds up fast. Here’s where it breaks down in real life.

  • You end up spending about an hour per high-performing post just on “send link” follow-ups and connection checks.
  • People get missed because comments come in over hours or days, not in one tidy batch.
  • You hesitate to post the next lead magnet because you still aren’t sure who already received it.
  • Duplicate outreach happens, which looks sloppy and can hurt trust before a call even gets booked.

The Solution: Trigger-Word Comments → Logged Leads + Smart Follow-Up

This n8n workflow monitors comments on a specific LinkedIn post and looks for trigger words you choose (like “guide”, “deck”, or “template”). When it finds a match, it checks the commenter’s connection level, then takes the right action automatically. If they’re a 1st-degree connection, it sends a DM with your lead magnet link and logs the interaction in NocoDB so you don’t message them again. If they’re not connected, it replies to the comment asking them to connect (using rotated reply variations so it doesn’t sound copy-pasted) and logs that “connection ask” too. Under the hood, it also pulls existing “already messaged” and “already asked” rows from NocoDB, then excludes anyone you’ve already handled.

The workflow starts with a form submission where you set the post ID, trigger word, and the lead magnet link. From there it fetches LinkedIn comments via Unipile, filters down to eligible commenters, and routes them through DM or comment reply. Finally, every action gets recorded in NocoDB, which means the next run stays clean and repeat-free.

What You Get: Automation vs. Results

Example: What This Looks Like

Say one post gets 40 comments, and 15 of them include your trigger word. Manually, you’ll click into profiles, check connection status, send a DM or write a reply, then log it somewhere, which is maybe 4 minutes per person (about an hour total). With this workflow, you spend about 5 minutes filling in the form (post ID, trigger word, link), then n8n runs the follow-up and logging in the background with built-in delays. You still spot-check results, but the repetitive “send + track + don’t duplicate” part is handled.

What You’ll Need

  • n8n instance (try n8n Cloud free)
  • Self-hosting option if you prefer (Hostinger works well)
  • Unipile for LinkedIn comment and DM API access.
  • NocoDB to store leads and prevent duplicates.
  • Unipile API key + NocoDB API token (from your Unipile dashboard and NocoDB account settings).

Skill level: Intermediate. You’ll connect credentials, create a simple NocoDB table, and paste in a few IDs/tokens.

Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).

How It Works

A form submission kicks things off. You enter the LinkedIn post ID, the trigger word you want to watch for, and the lead magnet link you plan to send.

Comments get pulled and filtered. n8n fetches the post comments through Unipile, unpacks them into individual items, then keeps only comments that contain your trigger word.

Connection status decides the next move. If the commenter is a 1st-degree connection, the workflow sends a DM with your link. If not, it replies to the comment with a connection prompt (and rotates reply text so it doesn’t look identical every time).

Everything is logged so repeats don’t happen. Before sending anything, it checks NocoDB for people already messaged or already asked to connect, excludes them, then logs the new action (DM sent or connection requested) with key details like LinkedIn ID, profile URL, post reference, and date.

You can easily modify the trigger word logic to support multiple keywords, or change the message templates to match your voice based on your needs. See the full implementation guide below for customization options.

Step-by-Step Implementation Guide

Step 1: Configure the Form Trigger

Set up the workflow intake form so new lead magnet requests start the automation.

  1. Add the Form Submission Trigger node as the workflow trigger.
  2. Set Form Title to Lead Magnet Request Form.
  3. Configure Form Fields with labels Post ID (required), Trigger word, and Lead Magnet Link.
  4. Connect Form Submission Trigger to Cursor State to start pagination from the first page.

Tip: Ensure the “Post ID” submitted matches a valid LinkedIn post URN, because it is injected into the API URL in Fetch Post Comments.

Step 2: Connect the Comment Retrieval Loop

Pull comments from the target post and prepare each comment for filtering.

  1. In Cursor State, keep the JS code that returns { cursor } based on the previous Fetch Post Comments result.
  2. Configure Fetch Post Comments with URL set to ={{$vars.unipileroot}}/posts/ urn:li:activity:{{ $('Form Submission Trigger').first().json["Post ID"] }}/comments.
  3. Set Query Parameters to include account_id with value ={{ $vars.unipile_linkedin }} and cursor parameters using ={{$json.cursor? "cursor": ""}} and ={{ $json.cursor }}.
  4. Credential Required: Connect your httpHeaderAuth credentials in Fetch Post Comments.
  5. In Unpack Comment Items, set Field to Split Out to items.

⚠️ Common Pitfall: If $vars.unipileroot or $vars.unipile_linkedin is missing in your environment variables, the comment retrieval will fail.

Step 3: Filter and Qualify Commenters

Filter only commenters who used the trigger word and are eligible for outreach.

  1. In Filter Trigger Comments, set the condition to check ={{ $json.text.toLowerCase() }} contains ={{ $('Form Submission Trigger').first().json["Trigger word"] }}.
  2. In Verify Connection Level, set the condition to match ={{ $json.author_details.network_distance }} equals DISTANCE_1.
  3. Credential Required: Connect your nocoDbApiToken credentials in Retrieve Sent DM Rows and set Options → Where to (dm_status,eq,sent).
  4. Credential Required: Connect your nocoDbApiToken credentials in Retrieve Asked Connection Rows and set Options → Where to (dm_status,eq,connection request).
  5. Keep the JS in Exclude Already Messaged and Exclude Already Requested to filter out LinkedIn IDs already logged in NocoDB.
  6. Ensure Check Sent List and Check Asked List both check that ={{ $json.filtered }} is not empty, then continue to Unpack Eligible Items and Unpack Asked Items.

Step 4: Send DMs and Replies in Batches

Batch eligible comments, wait between sends, and send DMs plus public replies.

  1. In Unpack Eligible Items, keep Field to Split Out as filtered, then route to Batch Iterate Comments.
  2. In Batch Iterate Comments, keep Options → Reset as false to process batches sequentially.
  3. Configure Delay Interval with Amount set to ={{ Math.floor(Math.random() * 4) + 8 }} to stagger actions.
  4. Configure Dispatch Lead Magnet DM with URL ={{$vars.unipileroot}}/chats and body fields including account_id, attendees_ids, and the DM text containing {{ $('Form Submission Trigger').first().json["Lead Magnet Link"] }}.
  5. Credential Required: Connect your httpHeaderAuth credentials in Dispatch Lead Magnet DM.
  6. In Rotate Reply Messages, keep the JS code that adds reply_message to each item.
  7. Configure Reply to Comment with URL ={{ $vars.unipileroot }}/posts/{{ $('Batch Iterate Comments').item.json.post_urn }}/comments and body parameters for account_id, comment_id, and text set to ={{ $json.reply_message }}.
  8. Credential Required: Connect your httpHeaderAuth credentials in Reply to Comment.

Tip: The execution flow is sequential—Batch Iterate CommentsDelay IntervalDispatch Lead Magnet DMRotate Reply MessagesReply to Comment—so test with a single comment first.

Step 5: Log Outreach Records to NocoDB

Persist DM and connection-request outcomes to your NocoDB tables.

  1. In Log DM Record, set Operation to create, and update Project ID and Table from [YOUR_ID] to your actual NocoDB IDs.
  2. Confirm the field mappings use expressions like ={{ $('Batch Iterate Comments').item.json.author_details.id }} and set dm_status to sent.
  3. Credential Required: Connect your nocoDbApiToken credentials in Log DM Record.
  4. In Log Connection Record, set Operation to create and update Project ID and Table from [YOUR_ID] to your actual NocoDB IDs.
  5. Confirm the field mappings use expressions like ={{ $('Unpack Asked Items').item.json.author_details.id }} and set dm_status to connection request.
  6. Credential Required: Connect your nocoDbApiToken credentials in Log Connection Record.

⚠️ Common Pitfall: Leaving [YOUR_ID] placeholders in Log DM Record or Log Connection Record will cause the workflow to fail silently on logging.

Step 6: Manage Pagination and Looping

Use the merge and filter nodes to continue fetching comments until all pages are processed.

  1. Ensure Combine Branches is set to Mode chooseBranch to merge flow after both outreach paths.
  2. In Filter Next Page, keep the condition ={{ $('Fetch Post Comments').first().json.cursor }} exists to decide whether to paginate.
  3. Confirm the loop order: Combine BranchesFilter Next PageCursor StateFetch Post Comments.

Step 7: Test and Activate Your Workflow

Validate end-to-end behavior, then enable the automation for live usage.

  1. Click Execute Workflow and submit a test entry through Form Submission Trigger with a real Post ID, Trigger word, and Lead Magnet Link.
  2. Confirm that Fetch Post Comments returns items and Filter Trigger Comments only passes matching comments.
  3. Verify successful actions: DMs sent via Dispatch Lead Magnet DM, replies posted via Reply to Comment, and records written in Log DM Record and Log Connection Record.
  4. When successful, toggle the workflow Active to enable production runs.
🔒

Unlock Full Step-by-Step Guide

Get the complete implementation guide + downloadable template

Common Gotchas

  • Unipile credentials can expire or need specific permissions. If things break, check your Unipile API key status and the selected LinkedIn account ID first.
  • If you’re using Wait nodes or external LinkedIn processing, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
  • Default message templates are usually bland. Add your brand voice early (and a clear CTA), or you will end up rewriting every DM and reply.

Frequently Asked Questions

How long does it take to set up this LinkedIn lead logging automation?

About 45 minutes if your Unipile and NocoDB accounts are ready.

Do I need coding skills to automate LinkedIn lead logging?

No. You’ll connect accounts, paste tokens, and customize a couple message fields. The only “technical” part is creating the NocoDB table columns correctly.

Is n8n free to use for this LinkedIn lead logging workflow?

Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Unipile costs for LinkedIn API access.

Where can I host n8n to run this automation?

Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.

Can I customize this LinkedIn lead logging workflow for multiple trigger words?

Yes, but you’ll want to adjust the trigger filtering so it checks a list instead of a single word. Most people update the “Filter Trigger Comments” logic to match any keyword in an array, then tweak the DM text to insert the right link per keyword. You can also expand the reply rotation script to include more variations, which keeps comment replies from looking repetitive.

Why is my Unipile connection failing in this workflow?

Usually it’s an expired token or the wrong LinkedIn account ID being used in the request. Regenerate your Unipile API key, confirm the root URL and account ID environment variables, then re-test the “Fetch Post Comments” request. If it works for a few runs and then dies, rate limits are a common culprit when a post gets busy.

How many leads can this LinkedIn lead logging automation handle?

On a typical n8n Cloud plan, it can handle dozens to hundreds of comments per post as long as you keep the built-in delays.

Is this LinkedIn lead logging automation better than using Zapier or Make?

Often, yes, because the “no duplicates” part is where simpler tools get annoying fast. This workflow checks two separate histories (already DMed, already asked to connect), merges branches, and keeps iterating through comment pages with cursor state, which is much easier to express in n8n without paying extra for every conditional step. Another practical win is self-hosting, so if you get a big spike in engagement you won’t panic about task limits. Zapier or Make can still be fine for a basic “new thing → log it” flow. If you want help choosing, Talk to an automation expert.

Once this is running, your best-performing posts stop creating extra work. The workflow handles the repetitive follow-up and logging, and you get to focus on the conversations that actually turn into revenue.

Need Help Setting This Up?

Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.

Lisa Granqvist

Workflow Automation Expert

Expert in workflow automation and no-code tools.

×

Use template

Get instant access to this n8n workflow Json file

💬
Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Get a free quote today!
Get a free quote today!

Tell us what you need and we'll get back to you within one working day.

Launch login modal Launch register modal