{
  "name": "Cross-post to multiple channels",
  "nodes": [
    {
      "parameters": {},
      "id": "d3e4f5a6-0001-4a5b-9c0d-111111111111",
      "name": "When clicking 'Test workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "// Edit the values below, then run the workflow.\n// content: the message posted to every channel (per-channel overrides supported, see below).\n// channels: one entry per destination. platform = provider identifier for settings.__type\n// (x, instagram, linkedin, threads, mastodon, bluesky, ...). Optional per-channel 'content'\n// replaces the shared content for that channel (handy for hashtags).\nconst content = 'Same idea, every network. \ud83d\ude80';\nconst channels = [\n  { id: 'REPLACE_WITH_CHANNEL_ID', platform: 'x' },\n  { id: 'REPLACE_WITH_CHANNEL_ID_2', platform: 'linkedin' }\n];\n\nreturn [{\n  json: {\n    body: {\n      type: 'now',\n      date: '',\n      shortLink: false,\n      tags: [],\n      posts: channels.map((ch) => ({\n        integration: { id: ch.id },\n        value: [{ content: ch.content || content, image: [] }],\n        settings: { __type: ch.platform }\n      }))\n    }\n  }\n}];"
      },
      "id": "d3e4f5a6-0002-4a5b-9c0d-222222222222",
      "name": "1. Post content and channels",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        220,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.postsider.com/public/v1/posts",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify($json.body) }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Idempotency-Key",
              "value": "=post-{{ $now.toISO() }}"
            }
          ]
        }
      },
      "id": "d3e4f5a6-0003-4a5b-9c0d-333333333333",
      "name": "2. Cross-post in one call",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        440,
        0
      ],
      "credentials": {
        "httpHeaderAuth": {
          "id": "1",
          "name": "PostSider API Key"
        }
      }
    },
    {
      "parameters": {
        "height": 320,
        "width": 460,
        "content": "SETUP (once):\n\n1. Create an API key in PostSider: app.postsider.com > Settings > API. It starts with ps_.\n2. In n8n create a Header Auth credential: Name = Authorization, Value = your ps_ key.\n3. Select that credential on the '2. Cross-post in one call' node.\n4. Edit '1. Post content and channels': add one entry per destination channel.\n\nOne call, many channels: PostSider accepts multiple posts entries in a single request, so this workflow cross-posts atomically. Swap type 'now' for 'schedule' and add a date to queue them instead of publishing immediately.\n\nSelf-hosted PostSider? Replace api.postsider.com with your domain (add /api if needed).",
        "color": 3
      },
      "id": "d3e4f5a6-0004-4a5b-9c0d-444444444444",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -340
      ]
    },
    {
      "parameters": {
        "content": "SETUP STEP BY STEP\nFollow in order. Do this once per workflow.\n\nSTEP 1 - Create the n8n credential (Header Auth, do this once):\n  \"PostSider API Key\": Name = Authorization, Value = your ps_ key (app.postsider.com > Settings > API > Create key).\n\nSTEP 2 - \"1. Post content and channels\" (Set node):\n  Fill in: text (your post), and the channels array with the integration ids of the channels you want to publish to (app > Settings > Channels). Add one entry per channel, optionally with its own value (e.g. different hashtags).\n\nSTEP 3 - Select the \"PostSider API Key\" credential on:\n  - \"2. Cross-post in one call\"\n\nSTEP 4 - Run:\n  Click \"Test workflow\" once. One API call publishes the post to all listed channels.\n\nNOTE\nSelf-hosted PostSider? Replace api.postsider.com with your domain (add /api if your install serves the API under /api).",
        "height": 620,
        "width": 640,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        -700
      ],
      "id": "setup-step-cross-post-channels",
      "name": "Setup step by step"
    }
  ],
  "connections": {
    "When clicking 'Test workflow'": {
      "main": [
        [
          {
            "node": "1. Post content and channels",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1. Post content and channels": {
      "main": [
        [
          {
            "node": "2. Cross-post in one call",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {}
}