đź’¬ Auto-send DMs to LinkedIn keyword commenters with ConnectSafely.AI

⚡ 113 views · 💬 Lead Nurturing & AI Sales Agents

💡 Pro Tip — If you need GitHub data beyond what the REST API gives you, ScraperNode has a repository scraper that extracts metadata at scale without token rate limits.

View All Scrapers

Description

Auto-Send DMs to LinkedIn Commenters Who Type a Specific Keyword using ConnectSafely.AI API

Who’s it for

This workflow is built for content creators, coaches, course sellers, and marketers who use the “comment X to get the link” engagement strategy on LinkedIn. Perfect for anyone who wants to deliver lead magnets, code samples, templates, or resources automatically without spending hours manually DMing every commenter.

If you’re tired of the manual grind—reading comments, checking connections, copy-pasting messages—this automation handles the entire fulfillment process while you focus on creating more content. Works especially well for viral posts where comment volume makes manual responses impossible.

How it works

The workflow monitors your LinkedIn post for specific keyword triggers and automatically sends personalized DMs to commenters who request your content.

The process flow:

  1. You submit your post URL, trigger keyword, and resource link via a simple form
  2. Fetches all comments from the specified LinkedIn post via ConnectSafely.ai API
  3. Loops through each comment individually for processing
  4. Detects if the comment contains your trigger keyword (case-insensitive)
  5. Checks if the commenter is a 1st-degree connection (required for DMs)
  6. Sends a personalized direct message with their name and your resource link
  7. Applies random rate limiting (15-30 minutes) between messages for account safety
  8. Continues until all matching comments are processed

The rate limiting and connection checks are built-in to protect your LinkedIn account from automation detection.


Setup steps

Step 1: Get Your ConnectSafely.ai API Key

Obtain API Key

  1. Sign up at ConnectSafely.ai
  2. Log into your dashboard
  3. Navigate to Settings → API Keys
  4. Generate a new API key and copy it

Add Credential in n8n

  1. Go to Credentials in n8n
  2. Click Add Credential → Search for ConnectSafely API
  3. Paste your API key
  4. Save the credential

This credential is used by all ConnectSafely nodes in the workflow.

Step 2: Connect Your LinkedIn Account

  1. In your ConnectSafely.ai dashboard, click Connect LinkedIn
  2. Follow the authorization flow
  3. Ensure your account shows as “Connected” with a green status
  4. Your LinkedIn is now accessible via the API

Step 3: Import and Configure the Workflow

  1. Download the workflow JSON file
  2. In n8n, go to Workflows → Import from File
  3. Select the downloaded JSON
  4. Open each ConnectSafely node and select your credential from the dropdown

Step 4: Test the Workflow

  1. Click the Test Workflow button in n8n
  2. Copy the form URL that appears in the Form Trigger node
  3. Open the URL in a new browser tab
  4. Fill in the form:
    • LinkedIn Post URL: Full URL of your post with comments
    • Trigger Keyword: The word commenters type (e.g., “code”, “link”, “example”)
    • Content Link: The URL you want to send them
    • Your Name: For the message signature
  5. Submit and watch the execution

Pro Tip: Test with your own post first where you’ve left a test comment containing the keyword.

Step 5: Activate for Production

  1. Review the test execution to ensure messages sent correctly
  2. Toggle the workflow to Active
  3. Use the form URL whenever you post new “comment for link” content
  4. The workflow processes comments and sends DMs automatically

Customization

Message Template

Edit the Send DM with Link node to customize your message:

Hey {{name}}! đź‘‹

Thanks for your comment on my post!

As promised, here's the link you requested:
👉 {{link}}

If you have any questions or want more resources like this, just let me know!

Best,
{{your_name}}

Variables available:

Multiple Keywords

Edit the Detect Keyword Match code node to check for multiple trigger words:

// Multiple keyword detection
const keywords = ['code', 'example', 'template', 'link', 'send'];
const commentLower = commentText.toLowerCase();

const isMatch = keywords.some(keyword => 
  commentLower.includes(keyword.toLowerCase())
);

return [{ json: { isKeywordMatch: isMatch, commentText } }];

Rate Limiting Adjustment

Edit the Wait: Rate Limiting node to change delays:

Risk LevelWait TimeFormula
🟢 Safest30-60 minMath.floor(Math.random() * (3600 - 1800 + 1)) + 1800
🟡 Moderate (Default)15-30 minMath.floor(Math.random() * (1800 - 900 + 1)) + 900
đź”´ Faster (Risky)5-15 minMath.floor(Math.random() * (900 - 300 + 1)) + 300

Warning: Shorter delays increase the risk of LinkedIn flagging your account.

Add Connection Requests (Optional)

To also send connection requests to non-connected commenters:

  1. Add a ConnectSafely LinkedIn node after the “If: Connected?” FALSE path
  2. Set operation to sendConnectionRequest
  3. Map the publicIdentifier from the loop
  4. Add a personalized connection message

Use Cases


Troubleshooting

Common Issues & Solutions

Issue: No comments returned from post

Issue: “Cannot send message” errors

Issue: Messages not being sent

Issue: Keyword not matching comments

Issue: Workflow seems slow

Issue: LinkedIn account warnings

Issue: Duplicate messages sent


Safety Best Practices

LinkedIn Account Protection

Do ✅Don’t ❌
Use random delays (built-in)Send messages without delays
Process 20-30 comments per batchProcess 100+ comments at once
Run during business hoursRun 24/7 continuously
Stop if you see warningsIgnore LinkedIn restrictions
Keep messages helpfulSend salesy/spammy content
Respond to genuine requestsUse for cold outreach

Daily Limits (Approximate)

Account TypeRecommended Max DMs/Day
Free Account30-50
Premium50-80
Sales Navigator80-100

These are conservative estimates. LinkedIn doesn’t publish exact limits.


Documentation & Resources

Official Documentation

Support Channels


Connect With Us

Stay updated with the latest automation tips, LinkedIn strategies, and platform updates:


Need Custom Workflows?

Looking to build sophisticated LinkedIn automation workflows tailored to your business needs?

Contact our team for custom automation development, strategy consulting, and enterprise solutions.

We specialize in:

đź”— Nodes Used

n8n Form Trigger

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup