Guide

LinkedIn in n8n: profiles, invitations and new connections by API

n8n's own LinkedIn node only creates posts, but its HTTP Request and Webhook nodes can drive a LinkedIn API. Here is how to set that up with Lempile, node by node: a credential, a workflow that reacts when someone accepts an invitation and waits for a person's OK in Slack before writing, and a paced list of invitations.

By Lempile · Updated

1. Connect an account and add the credential

Connect the LinkedIn account in Lempile first, from the dashboard or with a hosted auth link your user opens, and note its account_id. Then, in n8n, create one credential every HTTP Request node will share:

SettingValue
AuthenticationGeneric credential type
Generic Auth TypeHeader Auth
NameX-API-KEY
ValueYour Lempile API key

Every call below goes to https://direct.lempile.com/api/v1 and takes the account's account_id.

2. When someone accepts an invitation, read their profile

Start the workflow with a Webhook node: method POST, a path such as linkedin-new-connection, and Authentication set to Header Auth with a header name and secret of your own. n8n gives the node a Test URL, live while you listen for a test event, and a Production URL, live once the workflow is published. Register the Production URL with Lempile once, sending your secret as a header with every delivery:

Register the webhook (once)
curl -sS -X POST "https://direct.lempile.com/api/v1/webhooks" \
  -H "X-API-KEY: $LEMPILE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_url": "https://your-n8n.example.com/webhook/linkedin-new-connection",
    "source": "users",
    "name": "new-connections",
    "headers": [{ "key": "x-webhook-secret", "value": "a-long-random-secret" }]
  }'

From then on, every accepted invitation, sent or received, starts the workflow with this payload: often within about a minute, when LinkedIn notifies the account, and otherwise at the next regular check, every 30 to 60 minutes. The Webhook node puts it under body:

What the Webhook node receives
{
  "event": "new_relation",
  "account_id": "00000000-0000-4000-8000-0000000000a1",
  "webhook_name": "new-connections",
  "user_full_name": "Bob Buyer",
  "user_provider_id": "ACoAAAzyxwvutsrqponml",
  "user_public_identifier": "bob-buyer",
  "user_profile_url": "https://www.linkedin.com/in/bob-buyer/",
  "timestamp": 1793260931000
}

Add an HTTP Request node, GET, with the credential above, to read the new connection's profile and current job:

HTTP Request URL
https://direct.lempile.com/api/v1/users/{{ $json.body.user_provider_id }}
  ?account_id={{ $json.body.account_id }}&linkedin_sections=experience

It answers the profile with headline, location and work_experience; every field is in LinkedIn profile API and the profiles docs.

3. Wait for a person's OK, then send

Keep a person in the loop for anything that writes. Draft the welcome message from the profile, then add a Slack node with the operation Send and Wait for Response: n8n posts the draft and holds the workflow until someone answers, right in Slack. Route the answer with an IF node, and on approval send the message with one more HTTP Request node, POST to /chats, JSON body:

HTTP Request body (POST /chats)
{
  "account_id": "{{ $('Webhook').item.json.body.account_id }}",
  "attendees_ids": ["{{ $('Webhook').item.json.body.user_provider_id }}"],
  "text": "Thanks for connecting, {{ $('Webhook').item.json.body.user_full_name.split(' ')[0] }}!"
}
  • Add the header Idempotency-Key, for example welcome- followed by the provider id. If n8n retries the node, LinkedIn still gets one message.
  • While you build, add ?dry_run=true to the URL: Lempile answers with exactly what LinkedIn would receive and sends nothing. Remove it when the output looks right.

4. Send invitations from a list, paced

For a list of people, a Google Sheet for example, loop over the rows and send each invitation with an HTTP Request node, POST to /users/invite:

HTTP Request body (POST /users/invite)
{
  "account_id": "{{ $json.account_id }}",
  "provider_id": "{{ $json.profile_url }}",
  "message": "{{ $json.note }}"
}
  • provider_id takes a profile URL, a public identifier or a provider id. Keep the note under 200 characters, LinkedIn's own limit for connection notes (LinkedIn character limits).
  • Someone already connected or already invited answers 422 with a clear type, such as errors/already_connected, so set the node's On Error to continue with the error output and log those rows instead of stopping.
  • Space the calls with the HTTP Request node's Batching option (Items per Batch 1 and a Batch Interval), and remember LinkedIn's own pace: LinkedIn connection and invitation limits.

Pacing and errors

Lempile paces each account itself: one LinkedIn call at a time, 1.5 to 3 seconds apart, at most 1,500 calls and 150 writes a day, and a 15-minute rest when LinkedIn asks the account to slow down. A call over a limit answers 429 with retry_after. Turn on the node's Retry On Fail for those, and keep the Idempotency-Key on every write so a retry never sends twice. The full list is in the errors and limits docs.

Coming from Unipile

Lempile answers Unipile's LinkedIn paths, fields, status codes and error types, and sends Unipile's webhook payloads. HTTP Request nodes built for Unipile keep working once their base URL and key point at Lempile; the migration guide lists the differences.

FAQ

Questions, answered.

Can n8n send LinkedIn messages and invitations?
n8n's LinkedIn node creates posts and nothing else. For messages, invitations and other members' profiles, its HTTP Request node can call an API like Lempile with a Header Auth credential, and its Webhook node receives the webhooks.
I have n8n workflows built on Unipile. What changes?
Lempile answers Unipile's LinkedIn paths, fields and errors, so HTTP Request nodes built for Unipile keep working once you change the base URL and the key. Webhooks keep Unipile's payloads too.
How do I trigger a workflow when someone accepts my invitation?
Register a users webhook pointing at your n8n Webhook node's Production URL. Lempile sends new_relation when an invitation is accepted, either way: often within about a minute, otherwise within the hour.
How do I avoid sending too fast from n8n?
Lempile paces every account itself (one call at a time, at most 150 writes a day), so a fast loop can't burst. Calls over a limit answer 429 with retry_after: turn on Retry On Fail, or slow the loop with the HTTP Request node's batching.
Can I test a workflow without sending anything?
Yes: add ?dry_run=true to any write to see exactly what LinkedIn would receive, without sending it. Do that until the workflow is right.

Your n8n workflows, on LinkedIn.

Lempile reads profiles, inboxes and search, and sends messages, invitations and posts through accounts your users connect, with webhooks n8n can catch. Unipile-compatible. 7-day free trial, no card needed.

Sources (read on 4 November 2026)