n8n social media automation: Instagram, TikTok, Facebook and more
easyCoexistence connects n8n to Instagram, TikTok, Facebook, YouTube and more channels through each network's official API. Instagram and Facebook comments, mentions and DMs, and TikTok comments, reach a Webhook node as signed events. An AI Agent node with the easyCoexistence MCP server as its tool publishes, schedules, replies and reads analytics, and HTTP Request nodes call each network's API directly.
One of the authentication methods n8n's MCP Client Tool node supports, beside bearer, header and multiple-header auth.
Dynamic client registration in n8n's MCP credential, through which n8n registers itself with an MCP server as an OAuth client.
The n8n release that added the HTTP Streamable transport to the MCP Client Tool node, keeping SSE for older servers.
MCP tools behind one easyCoexistence connector, for publishing, comments, DMs, automations and analytics.
How long Instagram lets an app reply after most actions that open a conversation, such as a person's message.
What can an n8n workflow do on each network?
Publish, schedule, reply and measure, as far as each network's API allows. A workflow can put a photo, carousel, Reel or Story on Instagram, a text, link, photo or video on a Facebook Page, a video or photo post on TikTok and an upload on YouTube. It can reply to comments on each of them and on LinkedIn, reply to DMs on Instagram and Messenger, and read each network's own analytics. LinkedIn posts stay out of workflows: an agent drafts each one on request, for example in Claude or ChatGPT, and a person approves it before it goes out.
Instagram, Facebook and TikTok push their events, so a comment or a DM starts a run as soon as easyCoexistence passes it on. For YouTube and LinkedIn, a Schedule Trigger node starts the workflow at the interval you choose, and the workflow reads the new comments itself.
How does a comment or DM start an n8n workflow?
Through a Webhook node set to POST. Publish the workflow, copy the node's Production URL and point the account's events at it with set_social_webhook_destination: ask Claude or ChatGPT to run it, or run it once yourself in an MCP Client node. The Partner API does the same through PUT /api/v1/channels/:id/webhook. Either way the account's signing secret comes back once, so store it in n8n straight away.
Each event is a POST with four fields: platform, the network; account_id, the ID the MCP tools and the Partner API take; external_id, the account's ID on the network; and entry, the network's own event, unchanged. The Webhook node answers at once by default, which suits the forward: it waits 8 seconds and does not retry. An Instagram DM arrives like this:
{
"platform": "instagram",
"account_id": "<ACCOUNT_ID>",
"external_id": "<INSTAGRAM_ACCOUNT_ID>",
"entry": {
"id": "<INSTAGRAM_ACCOUNT_ID>",
"time": 1793318400512,
"messaging": [
{
"sender": { "id": "<INSTAGRAM_SCOPED_ID>" },
"recipient": { "id": "<INSTAGRAM_ACCOUNT_ID>" },
"timestamp": 1793318399870,
"message": { "mid": "<MESSAGE_ID>", "text": "Do you ship to Lisbon?" }
}
]
}
}How does an AI Agent node act on the networks?
Attach an MCP Client Tool to the AI Agent node, with https://easycoexistence.com/api/mcp as its endpoint and HTTP Streamable as the transport. Choose OAuth2 for authentication: n8n's MCP credential registers itself with the server through dynamic client registration, which is on by default, and you approve the easyCoexistence sign-in. There is no API key to paste.
The agent can then call the tools for the accounts on your easyCoexistence account, from publish_instagram_post and publish_tiktok_post to reply_to_comment, send_social_dm and get_social_insights. Hand it the event's account_id with the comment, or with the DM's sender ID, and it replies on the right account. Under Tools to Include, pick Selected and tick only the tools the job needs. For a fixed step with no AI deciding, the MCP Client node runs one named tool as an ordinary node, with its arguments mapped from the event.
Endpoint https://easycoexistence.com/api/mcp
Server Transport HTTP Streamable
Authentication OAuth2 (dynamic client registration on)
Tools to Include SelectedHow do HTTP Request nodes call a network's API?
With credentials easyCoexistence issues and keeps renewed. At the start of each run, an HTTP Request node calls GET /api/v1/channels/<account_id>?credentials=1 on easyCoexistence, with a Partner API key from the dashboard as the bearer token. The answer holds the network's API base, the account's ID on the network and a current access token on TikTok, YouTube and LinkedIn. An MCP Client node running get_social_credentials returns the same without an API key.
The next HTTP Request node calls TikTok, Google or LinkedIn with that token, for anything the MCP tools leave out, such as a YouTube playlist or a LinkedIn reaction. The request goes straight to the network, so the network's own rules, limits and error codes apply.
GET https://easycoexistence.com/api/v1/channels/<ACCOUNT_ID>?credentials=1
Authorization: Bearer ec_live_…
{
"id": "<ACCOUNT_ID>",
"channel": "instagram",
"status": "connected",
"credentials": {
"platform": "instagram",
"graph_api_base": "https://graph.instagram.com/<VERSION>",
"account_id_on_meta": "<INSTAGRAM_ACCOUNT_ID>",
"access_token": "<CURRENT_TOKEN>",
"token_expires_at": "<EXPIRY>"
}
}How do you check the signature in n8n?
Each forwarded event carries an X-EC-Signature header in the form t=<unix>,v1=<hex>, where v1 is an HMAC-SHA256 of the timestamp, a dot and the raw request body, keyed with the account's signing secret.
In n8n, turn on the Webhook node's Raw Body option, then read the body as text with an Extract From File node set to Extract From Text File. A Crypto node computes an Hmac, with SHA256 and HEX, over the timestamp, a dot and that text, keyed with the signing secret. An If node lets the run continue only when the result equals v1 and the timestamp is less than 5 minutes old, so everything after it, the AI Agent node included, works on events that really came from easyCoexistence.
What do the networks require of a workflow?
Each network's API sets rules that a workflow has to meet:
- Public HTTPS media: the networks download each file from its link, so host it first. Instagram publishes JPEG images, and TikTok photo posts take JPEG or WebP.
- TikTok's verified URLs: TikTok downloads media only from URL prefixes verified for the publishing app, so publish with
publish_tiktok_post, which hands TikTok your file through easyCoexistence's verified media route. - The 24-hour window: Instagram and Messenger take a DM reply within 24 hours of the person's last message, and Instagram only once the account allows access to messages in the app.
- TikTok conversations: there are no DMs on TikTok, so the workflow replies to TikTok comments in public, under the comment.
- Rotating tokens: TikTok and YouTube tokens expire and are renewed by easyCoexistence, so fetch credentials in each run instead of saving one in n8n.
Common mistakes
- Pointing events at the Webhook node's Test URL. n8n listens there only while you test; the Production URL is the one it registers when the workflow is published.
- Sending events to an n8n that answers only on localhost. easyCoexistence forwards to public HTTPS addresses, so put the instance behind a domain with a certificate, or use n8n Cloud.
- Computing the HMAC over the parsed body. Without Raw Body the workflow holds a parsed copy, and a copy serialized again does not reliably match the bytes that were signed.
- Replying to the account's own messages. A DM the account sends comes back as a message event with is_echo set to true, and a reply to it starts a loop.
easyCoexistence gives the AI agents in your n8n workflows reach to customers on Instagram, Facebook, TikTok, YouTube and more channels, each on its official API: signed events for a Webhook node, 35+ MCP tools for an AI Agent node and fresh credentials for HTTP Request nodes. US$ 9 to US$ 0.75 per connection per month, falling as you add connections, with the first 3 days free.
easyCoexistence is a multichannel API and MCP server that connects AI agents such as Claude and ChatGPT to WhatsApp, Instagram, TikTok, Facebook and more. On WhatsApp it uses Coexistence: the business keeps using its number in the WhatsApp Business app while the AI works through Meta's official API.
Frequently asked questions
Can n8n connect to the easyCoexistence MCP server?
Yes. An MCP Client Tool on an AI Agent node, or an MCP Client node, connects to https://easycoexistence.com/api/mcp over HTTP Streamable with OAuth2. n8n registers itself as a client, and you approve the sign-in.
Can n8n post to Instagram, TikTok and Facebook?
Yes, through the agent's publishing tools, such as publish_instagram_post, publish_tiktok_post and publish_facebook_post, with the media for each post at a public HTTPS link.
Which networks can trigger an n8n workflow?
Instagram and Facebook, with comments, mentions and DMs, and TikTok, with comments. YouTube and LinkedIn workflows start from a Schedule Trigger node and read new comments on each run.
How much does easyCoexistence cost for n8n?
US$ 9 to US$ 0.75 per connection per month, falling as you add connections, and the same on each network. The MCP server and the Partner API come with it, and the first 3 days are free.
Keep reading
Connect your first channel in two minutes.
No platform reviews to wait for. Connect WhatsApp, Instagram, TikTok or another channel, then ask your AI to post, reply or report, and watch it work.
- 3 days free
- Cancel any time
- Official APIs only
- Monitored 24/7
Verified on