LinkedIn + NocoDB: comment leads logged, no repeats
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
flowchart LR
subgraph sg0["On form submission Flow"]
direction LR
n0["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Get Comments from Posts"]
n1@{ icon: "mdi:swap-vertical", form: "rounded", label: "Split Out1", pos: "b", h: 48 }
n2@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Check if we are connected", pos: "b", h: 48 }
n3@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Filter Comments with trigger", pos: "b", h: 48 }
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Send DM with Lead Magnet"]
n5["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Answer to comment"]
n6["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Create Message Rotation"]
n7["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/nocodb.svg' width='40' height='40' /></div><br/>Create a row"]
n8["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Ask For connection"]
n9@{ icon: "mdi:swap-vertical", form: "rounded", label: "Loop Over Items1", pos: "b", h: 48 }
n10@{ icon: "mdi:cog", form: "rounded", label: "Wait", pos: "b", h: 48 }
n11@{ icon: "mdi:swap-vertical", form: "rounded", label: "Split Out2", pos: "b", h: 48 }
n12["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>cursor"]
n13["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/merge.svg' width='40' height='40' /></div><br/>Merge1"]
n14@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Filter1", pos: "b", h: 48 }
n15["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/nocodb.svg' width='40' height='40' /></div><br/>Create a row2"]
n16["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/form.svg' width='40' height='40' /></div><br/>On form submission"]
n17["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/nocodb.svg' width='40' height='40' /></div><br/>Get all the rows where the d.."]
n18["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/nocodb.svg' width='40' height='40' /></div><br/>Get all the rows where the c.."]
n19@{ icon: "mdi:swap-horizontal", form: "rounded", label: "If", pos: "b", h: 48 }
n20@{ icon: "mdi:swap-vertical", form: "rounded", label: "Split Out", pos: "b", h: 48 }
n21@{ icon: "mdi:swap-horizontal", form: "rounded", label: "If1", pos: "b", h: 48 }
n22["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Filter people where we have .."]
n23["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Filter people where we have .."]
n19 --> n20
n19 --> n13
n21 --> n11
n21 --> n13
n10 --> n4
n13 --> n14
n12 --> n0
n14 --> n12
n20 --> n8
n1 --> n3
n11 --> n9
n7 --> n9
n15 --> n13
n9 --> n13
n9 --> n10
n5 --> n7
n8 --> n15
n16 --> n12
n6 --> n5
n0 --> n1
n4 --> n6
n2 --> n17
n2 --> n18
n3 --> n2
n17 --> n22
n22 --> n21
n23 --> n19
n18 --> n23
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n16 trigger
class n2,n3,n14,n19,n21 decision
class n0,n4,n5,n8 api
class n6,n12,n22,n23 code
classDef customIcon fill:none,stroke:none
class n0,n4,n5,n6,n7,n8,n12,n13,n15,n16,n17,n18,n22,n23 customIcon
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
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
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.
- Add the Form Submission Trigger node as the workflow trigger.
- Set Form Title to
Lead Magnet Request Form. - Configure Form Fields with labels
Post ID(required),Trigger word, andLead Magnet Link. - Connect Form Submission Trigger to Cursor State to start pagination from the first page.
Step 2: Connect the Comment Retrieval Loop
Pull comments from the target post and prepare each comment for filtering.
- In Cursor State, keep the JS code that returns
{ cursor }based on the previous Fetch Post Comments result. - Configure Fetch Post Comments with URL set to
={{$vars.unipileroot}}/posts/ urn:li:activity:{{ $('Form Submission Trigger').first().json["Post ID"] }}/comments. - Set Query Parameters to include
account_idwith value={{ $vars.unipile_linkedin }}and cursor parameters using={{$json.cursor? "cursor": ""}}and={{ $json.cursor }}. - Credential Required: Connect your httpHeaderAuth credentials in Fetch Post Comments.
- In Unpack Comment Items, set Field to Split Out to
items.
$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.
- In Filter Trigger Comments, set the condition to check
={{ $json.text.toLowerCase() }}contains={{ $('Form Submission Trigger').first().json["Trigger word"] }}. - In Verify Connection Level, set the condition to match
={{ $json.author_details.network_distance }}equalsDISTANCE_1. - Credential Required: Connect your nocoDbApiToken credentials in Retrieve Sent DM Rows and set Options → Where to
(dm_status,eq,sent). - Credential Required: Connect your nocoDbApiToken credentials in Retrieve Asked Connection Rows and set Options → Where to
(dm_status,eq,connection request). - Keep the JS in Exclude Already Messaged and Exclude Already Requested to filter out LinkedIn IDs already logged in NocoDB.
- 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.
- In Unpack Eligible Items, keep Field to Split Out as
filtered, then route to Batch Iterate Comments. - In Batch Iterate Comments, keep Options → Reset as
falseto process batches sequentially. - Configure Delay Interval with Amount set to
={{ Math.floor(Math.random() * 4) + 8 }}to stagger actions. - Configure Dispatch Lead Magnet DM with URL
={{$vars.unipileroot}}/chatsand body fields includingaccount_id,attendees_ids, and the DMtextcontaining{{ $('Form Submission Trigger').first().json["Lead Magnet Link"] }}. - Credential Required: Connect your httpHeaderAuth credentials in Dispatch Lead Magnet DM.
- In Rotate Reply Messages, keep the JS code that adds
reply_messageto each item. - Configure Reply to Comment with URL
={{ $vars.unipileroot }}/posts/{{ $('Batch Iterate Comments').item.json.post_urn }}/commentsand body parameters foraccount_id,comment_id, andtextset to={{ $json.reply_message }}. - Credential Required: Connect your httpHeaderAuth credentials in Reply to Comment.
Step 5: Log Outreach Records to NocoDB
Persist DM and connection-request outcomes to your NocoDB tables.
- In Log DM Record, set Operation to
create, and update Project ID and Table from[YOUR_ID]to your actual NocoDB IDs. - Confirm the field mappings use expressions like
={{ $('Batch Iterate Comments').item.json.author_details.id }}and setdm_statustosent. - Credential Required: Connect your nocoDbApiToken credentials in Log DM Record.
- In Log Connection Record, set Operation to
createand update Project ID and Table from[YOUR_ID]to your actual NocoDB IDs. - Confirm the field mappings use expressions like
={{ $('Unpack Asked Items').item.json.author_details.id }}and setdm_statustoconnection request. - Credential Required: Connect your nocoDbApiToken credentials in Log Connection Record.
[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.
- Ensure Combine Branches is set to Mode
chooseBranchto merge flow after both outreach paths. - In Filter Next Page, keep the condition
={{ $('Fetch Post Comments').first().json.cursor }}exists to decide whether to paginate. - Confirm the loop order: Combine Branches → Filter Next Page → Cursor State → Fetch Post Comments.
Step 7: Test and Activate Your Workflow
Validate end-to-end behavior, then enable the automation for live usage.
- Click Execute Workflow and submit a test entry through Form Submission Trigger with a real
Post ID,Trigger word, andLead Magnet Link. - Confirm that Fetch Post Comments returns items and Filter Trigger Comments only passes matching comments.
- 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.
- When successful, toggle the workflow Active to enable production runs.
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
About 45 minutes if your Unipile and NocoDB accounts are ready.
No. You’ll connect accounts, paste tokens, and customize a couple message fields. The only “technical” part is creating the NocoDB table columns correctly.
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.
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.
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.
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.
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.
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.