Post to social media from n8n with Ampost
By ArturPublished Updated
The Ampost node for n8n publishes a post to every network you name in one step. Install the community node, add your API key as an Ampost API credential, import the workflow below and run it. On n8n Cloud, where the node can't be installed yet, the HTTP Request version of the same workflow does the same job.
What you'll build
- An n8n workflow that publishes a post to several social networks at once, with one Ampost node.
- A credential that keeps your Ampost API key out of the workflow JSON.
- A pattern you can put behind any n8n trigger: a schedule, a webhook, a new row, a new CMS entry or an AI agent's output.
Before you start
- An Ampost account. The Free plan includes the REST API (2 social accounts and 15 posts every 30 days); scheduling needs the Pro plan or higher, and X the Max and Scale plans. See pricing.
- An API key from Settings, API keys. The key is shown once, so copy it when you create it. Treat it like a password.
- At least one connected social account, under Settings, Connections in the dashboard.
- Self-hosted n8n 1.x or 2.x, where you can install community nodes. On n8n Cloud, use the HTTP Request workflow: it needs only built-in nodes.
Download
Free to use and change. The file is shown in full below, so you can read it before you run it.
{
"name": "Post to social media with Ampost",
"nodes": [
{
"parameters": {
"content": "## Post to social media with Ampost\nPublishes one post to every platform you list, through the Ampost node.\n\n### Setup\n1. Install the **n8n-nodes-ampost** community node (Settings → Community nodes).\n2. Create an Ampost credential with an API key from ampost.io → Settings → API keys.\n3. In **Post content**, set `text` and `platforms` (comma-separated: bluesky, threads, linkedin, twitter, instagram, facebook, tiktok, youtube, pinterest, telegram, discord). Each needs a connected account in Ampost.\n4. Click **Test workflow**.\n\nThe Idempotency-Key makes a retried request post once. Swap **Run it** for any trigger.",
"height": 520,
"width": 420,
"color": 4
},
"id": "e6349483-5374-4352-a132-cecd394c310a",
"name": "About this workflow",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-480,
-160
]
},
{
"parameters": {},
"id": "e81da8c3-03c3-4b5e-abc9-f00ce3efd022",
"name": "Run it",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
0,
0
]
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "71ecc67a-a6ee-497b-a4f1-f5ed3c7a813d",
"name": "text",
"value": "Hello from n8n and Ampost!",
"type": "string"
},
{
"id": "1dff2cb1-5784-488f-a260-abc608d68519",
"name": "platforms",
"value": "bluesky,threads",
"type": "string"
},
{
"id": "e8402075-06a0-4a08-a9d1-ca6934c16963",
"name": "link",
"value": "",
"type": "string"
}
]
},
"options": {}
},
"id": "bf858474-dc95-4b3a-aebe-12e0f7fd3481",
"name": "Post content",
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
240,
0
]
},
{
"parameters": {
"platforms": "={{ $json.platforms.split(',').map(p => p.trim()).filter(p => p) }}",
"text": "={{ $json.text }}",
"additionalFields": {
"idempotencyKey": "=n8n-{{ $execution.id }}-{{ $itemIndex }}",
"linkUrl": "={{ $json.link }}"
},
"platformOptions": {}
},
"id": "fe8e4a44-43bb-407a-a5e7-7fce7ab435e4",
"name": "Create post",
"type": "n8n-nodes-ampost.ampost",
"typeVersion": 1,
"position": [
480,
0
],
"credentials": {
"ampostApi": {
"id": "ampostApiCredential",
"name": "Ampost account"
}
},
"retryOnFail": true,
"maxTries": 3,
"waitBetweenTries": 5000
}
],
"connections": {
"Run it": {
"main": [
[
{
"node": "Post content",
"type": "main",
"index": 0
}
]
]
},
"Post content": {
"main": [
[
{
"node": "Create post",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
},
"pinData": {},
"meta": {
"templateCredsSetupCompleted": false
}
}
{
"name": "Post to social media with Ampost",
"nodes": [
{
"parameters": {},
"id": "4b0d5a52-7f43-4a8e-9a43-0f3a5d1f6b01",
"name": "Run it",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [0, 0]
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "a1f0c3d2-1b44-4c55-8d66-7e7788990011",
"name": "text",
"value": "Hello from n8n and Ampost!",
"type": "string"
},
{
"id": "a1f0c3d2-1b44-4c55-8d66-7e7788990012",
"name": "platforms",
"value": "bluesky,threads",
"type": "string"
},
{
"id": "a1f0c3d2-1b44-4c55-8d66-7e7788990013",
"name": "link",
"value": "",
"type": "string"
}
]
},
"options": {}
},
"id": "4b0d5a52-7f43-4a8e-9a43-0f3a5d1f6b02",
"name": "Post content",
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [220, 0]
},
{
"parameters": {
"method": "POST",
"url": "https://api.ampost.io/api/posts",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Idempotency-Key",
"value": "=n8n-{{ $execution.id }}-{{ $itemIndex }}"
}
]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify(Object.assign({ targets: [{ platforms: $json.platforms.split(',').map(p => p.trim()).filter(p => p) }], text: $json.text, publishNow: true }, $json.link ? { linkUrl: $json.link } : {})) }}",
"options": {}
},
"id": "4b0d5a52-7f43-4a8e-9a43-0f3a5d1f6b03",
"name": "Ampost: create post",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [440, 0],
"retryOnFail": true,
"maxTries": 3,
"waitBetweenTries": 5000,
"credentials": {
"httpHeaderAuth": {
"id": "ampostApiKey",
"name": "Ampost API key"
}
}
}
],
"connections": {
"Run it": {
"main": [[{ "node": "Post content", "type": "main", "index": 0 }]]
},
"Post content": {
"main": [[{ "node": "Ampost: create post", "type": "main", "index": 0 }]]
}
},
"settings": {
"executionOrder": "v1"
},
"pinData": {},
"meta": {
"templateCredsSetupCompleted": false
}
}
Steps
1. Install the Ampost community node
In n8n, open Settings, Community nodes, choose Install, enter
n8n-nodes-ampost, tick the box about community nodes and install. You get two nodes: Ampost and Ampost Trigger.For queue mode or a Docker image built ahead of time, install it from npm in n8n's nodes folder and restart n8n. The node's page lists everything it can do.
terminalcd ~/.n8n/nodes # create it with `npm init -y` if missing npm install n8n-nodes-ampost # restart n8n2. Add your API key as an Ampost API credential
In n8n, open Credentials, Add credential, search for Ampost API and paste your key. Leave Base URL as it is. n8n checks the key when you save.
The credential is stored encrypted by n8n and is not part of an exported workflow, so you can share the workflow without the key.
3. Import the workflow
Download the Ampost node workflow above. In n8n, open a new workflow, click the three-dot menu at the top right and choose Import from File (or paste the JSON onto the canvas).
You get three nodes: Run it (Manual Trigger), Post content (Edit Fields) and Create post (Ampost). Open Create post and pick your credential.
4. Write the post and pick the networks
Open Post content and set three fields:
text(the post),platforms(a comma-separated list) andlink(optional; leave it empty for none).Platform keys:
instagram(Instagram),facebook(Facebook),linkedin(LinkedIn),tiktok(TikTok),threads(Threads),twitter(X),discord(Discord),telegram(Telegram),bluesky(Bluesky),youtube(YouTube),pinterest(Pinterest). Each network you name needs a connected account in Ampost.Create post publishes now (When: Publish Now). Choose Schedule, Add to Queue or Save as Draft there instead. Its Idempotency Key is the execution id plus the item index, so n8n's Retry On Fail (on, 3 tries) never posts twice.
5. Run it
Click Execute workflow. Ampost publishes in the same call, so the Create post node's output is the finished post: its
id, itsstatus(published, orpartialorfailedwhen a network refused it) and one entry per account inplatformPosts, with the link to each live post.Some networks process video after the upload; their entry stays
processinguntil it is live. Add an Ampost Trigger workflow on the post events to see the final result.Create post output (shortened){ "id": "6f1c2a4e-…", "status": "published", "platforms": ["bluesky", "threads"], "platformPosts": [ { "platform": "bluesky", "status": "published", "publishedUrl": "https://bsky.app/profile/…/post/…" }, { "platform": "threads", "status": "published", "publishedUrl": "https://www.threads.net/@…/post/…" } ] }
Put it behind any trigger
Replace Run it with the trigger you need and map its fields into Post content: Schedule Trigger for a daily post, Webhook to post from your own app, Google Sheets or Airtable for a content calendar, RSS Feed Trigger for new articles (there is a ready-made RSS workflow), or an AI Agent node that writes the text. The Ampost node also works as a tool of the AI Agent.
Each item that reaches Create post becomes one post. To post an image or a video, upload it with the Ampost node's Media resource, or pass a public https URL; Ampost converts it to each network's limits.
On n8n Cloud: the HTTP Request workflow
n8n Cloud installs only community nodes that n8n has verified, and the Ampost node is not verified yet. Download the HTTP Request workflow above instead: it has the same Run it and Post content nodes, and an HTTP Request node in place of Create post. It runs on n8n Cloud, self-hosted n8n and the desktop app.
Open the Ampost: create post node. Under Credential for Header Auth, create a credential with Name Authorization and Value Bearer amp_live_... (your own key after the word Bearer and one space), and save it as Ampost API key.
The node sends POST https://api.ampost.io/api/posts with a JSON body built from the Post content fields, publishNow: true, and the execution id plus the item index as its Idempotency-Key header. The body expression, if you want to change it:
{{ JSON.stringify(Object.assign({
targets: [{ platforms: $json.platforms.split(',').map(p => p.trim()).filter(p => p) }],
text: $json.text,
publishNow: true
}, $json.link ? { linkUrl: $json.link } : {})) }}When the request fails
Ampost answers errors with a code and a message. The common ones: 401 UNAUTHORIZED (check the key in the credential; with Header Auth, its Bearer prefix), 400 VALIDATION_FAILED (the message names each wrong field), 403 UPGRADE_REQUIRED (a feature your plan lacks, such as scheduling), 429 RATE_LIMITED (retry later) and 429 QUOTA_EXCEEDED (your plan's monthly posts are used up).
Turn on the node's Settings, On Error, Continue (using error output) to route failed posts to a Slack or email node instead of stopping the workflow. All codes are in the API reference.
FAQ
Is there an Ampost community node for n8n?
Yes: n8n-nodes-ampost, with an Ampost node for posts, media, accounts and analytics, and an Ampost Trigger for post and account events. Install it from Settings, Community nodes on a self-hosted n8n.
Does this work on n8n Cloud and self-hosted n8n?
The Ampost node needs self-hosted n8n for now: n8n Cloud installs only verified community nodes, and this one is not verified yet. On n8n Cloud, use the HTTP Request workflow, which needs only built-in nodes.
Which social networks can I post to from n8n?
Every network you connect to Ampost: Instagram, Facebook, LinkedIn, TikTok, Threads, X, Discord, Telegram, Bluesky, YouTube, Pinterest. Name them by key in targets[].platforms; X is twitter. LinkedIn and TikTok are coming soon.
Can I schedule a post instead of publishing it now?
Yes. Send scheduledFor with an ISO 8601 time (for example 2027-01-14T15:00:00Z) instead of publishNow: true, and Ampost publishes it then. Scheduling needs the Pro plan or higher.
What happens if the same request is sent twice?
The templates send an Idempotency-Key header. A retry with the same key within 24 hours returns the first post instead of creating a second one, so a retried step never posts twice.