Tool Guides10 min read

n8n LinkedIn Automation with ConnectSafely API — Integration Guide 2026 | ConnectSafely

Connect n8n to LinkedIn using ConnectSafely's API. Automate connection requests, DMs, comment replies, and lead capture — with full node documentation and API plan pricing.

Anandi

LinkedIn has no official public API for automating outreach, DMs, or connection requests. ConnectSafely fills that gap with a REST API built specifically for LinkedIn automation — and it works with n8n's HTTP Request node out of the box.

If you are already running n8n for your marketing or sales stack, adding LinkedIn automation is a matter of one API key and a few HTTP Request nodes. For n8n's own pricing, see our n8n cloud pricing guide.

How ConnectSafely's API works with n8n

Connecting n8n to LinkedIn through ConnectSafely takes three steps. No custom code, no browser extensions, no headless browsers.

Want to Generate Consistent Inbound Leads from LinkedIn?

Get our complete LinkedIn Lead Generation Playbook used by B2B professionals to attract decision-makers without cold outreach.

How to build authority that attracts leads
Content strategies that generate inbound
Engagement tactics that trigger algorithms
Systems for consistent lead flow

No spam. Just proven strategies for B2B lead generation.

Step 1: Get your API key

Sign up at ConnectSafely and grab your API key from the dashboard. The API plan includes all LinkedIn automation endpoints.

Step 2: Add an HTTP Request node in n8n

In your n8n workflow, drop in an HTTP Request node. Set it up like this:

  • Method: POST (most endpoints use POST)
  • URL: https://api.connectsafely.ai/linkedin/{endpoint}
  • Authentication: Header auth
  • Header name: Authorization
  • Header value: Bearer YOUR_API_KEY

Step 3: Test with a simple call

Start with a profile fetch to confirm your connection works:

POST https://api.connectsafely.ai/linkedin/profile
{
  "profileId": "john-doe-123"
}

If you get a JSON response with profile data (firstName, lastName, headline, etc.), you are ready to build workflows.

What you can automate

ConnectSafely's linkedin automation api covers the actions that matter for outreach and lead generation. Here is what you can wire into n8n workflows:

Connection requests — Send personalized connection requests (rate limited to 90/week automatically).

POST /linkedin/connect
{
  "profileId": "sarah-jones-123",
  "customMessage": "Hi Sarah — saw your post on B2B growth. Would love to connect."
}

Direct messages — Send messages to connections. Supports regular messages and InMail.

POST /linkedin/message
{
  "recipientProfileId": "sarah-jones-123",
  "message": "Thanks for connecting. Here is the case study I mentioned.",
  "messageType": "normal"
}

Comment scraping

Pull comments from any LinkedIn post to qualify commenters and trigger outreach.

POST /linkedin/posts/comments
{
  "postUrl": "https://www.linkedin.com/feed/update/urn:li:activity:7431898703118110720"
}

Profile visitor tracking

Get people who viewed your profile. Use n8n's Schedule Trigger to check daily and route warm leads into your CRM.

POST /linkedin/profile/visitors
{
  "maxVisitors": 50,
  "timeRange": "past_7_days"
}

Post scraping

Pull post content, engagement counts, and metadata from any LinkedIn post.

POST /linkedin/posts/scrape
{
  "postUrl": "https://www.linkedin.com/posts/john-doe-123_example-activity-7430667226199830528-Cu89"
}

The API also supports following profiles (/linkedin/follow), searching people (/linkedin/search/people), reacting to posts (/linkedin/posts/react), replying to comments (/linkedin/reply), and fetching messages (/linkedin/messaging/recent-messages).

ConnectSafely API plan vs building LinkedIn automation yourself

FactorDIY (headless browser)ConnectSafely API plan
Setup time20-40 hours5 minutes
MaintenanceConstant (LinkedIn changes DOM monthly)Zero (maintained for you)
Account safetyHigh risk of bansBuilt-in rate limiting
Proxy costs$50-200/monthIncluded
ReliabilityBreaks frequently99.9% uptime SLA

For n8n pricing, check our n8n cloud pricing guide. ConnectSafely's API plan is separate from n8n's subscription.

Example workflow: LinkedIn post commenter to DM

This n8n workflow monitors a LinkedIn post, qualifies commenters, and sends them a personalized DM.

Node 1: Schedule Trigger — Run every 4 hours.

Node 2: HTTP Request — Get post comments

POST https://api.connectsafely.ai/linkedin/posts/comments
{
  "postUrl": "https://www.linkedin.com/feed/update/urn:li:activity:YOUR_POST_ID"
}

Returns commenters with profileUrl, authorName, authorDesignation, and commentText.

Node 3: IF node — Filter qualified leads

{{ $json.authorDesignation.match(/VP|Director|Head of|CMO|CTO/) ? true : false }}

Node 4: HTTP Request — Fetch full profile

For qualified leads, fetch their full profile:

POST https://api.connectsafely.ai/linkedin/profile
{
  "profileId": "{{ $json.publicIdentifier }}",
  "includeContact": true
}

Node 5: HTTP Request �� Send connection request

POST https://api.connectsafely.ai/linkedin/connect
{
  "profileId": "{{ $json.publicIdentifier }}",
  "customMessage": "Hi {{ $json.profile.firstName }} — loved your comment. Worth connecting?"
}

Node 6: Wait node — Wait 3 days for the connection to be accepted.

Node 7: IF node — Check connection status

GET https://api.connectsafely.ai/linkedin/relationship/{{ $json.publicIdentifier }}

Returns status: CONNECTED, INVITATION_SENT, INVITATION_RECEIVED, or NOT_CONNECTED. Proceed to DM only if connected.

Node 8: HTTP Request — Send DM

POST https://api.connectsafely.ai/linkedin/message
{
  "recipientProfileId": "{{ $json.publicIdentifier }}",
  "message": "Thanks for connecting. Your comment caught my eye — here is a case study: [link]."
}

This workflow runs on autopilot. New commenters get qualified, connected, and messaged without you touching n8n after the initial setup.

For AI-powered personalization, combine this with Claude Cowork's LinkedIn integration.

Get started

Get your ConnectSafely API key → | View the full API documentation →

About the Author

Anandi

Content Strategist, ConnectSafely.ai

LinkedIn growth strategist helping B2B professionals build authority and generate inbound leads.

LinkedIn MarketingB2B Lead GenerationContent StrategyPersonal Branding

Want to Generate Consistent Inbound Leads from LinkedIn?

Get our complete LinkedIn Lead Generation Playbook used by B2B professionals to attract decision-makers without cold outreach.

How to build authority that attracts leads
Content strategies that generate inbound
Engagement tactics that trigger algorithms
Systems for consistent lead flow

No spam. Just proven strategies for B2B lead generation.

Ready to Transform Your LinkedIn Strategy?

Stop chasing leads. Start attracting them with ConnectSafely.ai's inbound lead generation platform.

Get Started Free

See How It Works

Watch how people get more LinkedIn leads with ConnectSafely

Video thumbnail 1
Video thumbnail 2
Video thumbnail 3
Video thumbnail 4
240%
More profile views in 30 days
10-20
Inbound leads per month
8+
Hours saved every week
$35
Average cost per lead