{
  "name": "Postifys \u2014 Facebook + Instagram fan-out",
  "nodes": [
    {
      "parameters": {},
      "id": "manual-1",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "mode": "manual",
        "duplicateItem": false,
        "assignments": {
          "assignments": [
            {
              "id": "0",
              "name": "mediaUrl",
              "value": "https://example.com/asset.jpg",
              "type": "string"
            },
            {
              "id": "1",
              "name": "caption",
              "value": "Multi-platform via Postifys",
              "type": "string"
            },
            {
              "id": "2",
              "name": "pageId",
              "value": "FACEBOOK_PAGE_ID",
              "type": "string"
            },
            {
              "id": "3",
              "name": "instagramAccountId",
              "value": "INSTAGRAM_ACCOUNT_ID",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "set-1",
      "name": "Shared media",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        220,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://postifys.com/api/facebook/post",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ text: $json.caption, type: \"IMAGE\", mediaUrls: [$json.mediaUrl], pageId: $json.pageId }) }}",
        "options": {}
      },
      "id": "http-fb",
      "name": "Publish Facebook",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        -120
      ],
      "credentials": {
        "httpHeaderAuth": {
          "id": "REPLACE_WITH_POSTIFYS_HEADER_AUTH",
          "name": "Postifys API Key (Authorization: Bearer \u2026)"
        }
      },
      "notes": "Create Header Auth credential: Name=Authorization, Value=Bearer YOUR_API_KEY"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://postifys.com/api/instagram/post",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ type: \"IMAGE\", mediaUrls: [$json.mediaUrl], text: $json.caption, instagramAccountId: $json.instagramAccountId }) }}",
        "options": {}
      },
      "id": "http-ig",
      "name": "Publish Instagram",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        460,
        120
      ],
      "credentials": {
        "httpHeaderAuth": {
          "id": "REPLACE_WITH_POSTIFYS_HEADER_AUTH",
          "name": "Postifys API Key (Authorization: Bearer \u2026)"
        }
      },
      "notes": "Create Header Auth credential: Name=Authorization, Value=Bearer YOUR_API_KEY"
    }
  ],
  "connections": {
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Shared media",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Shared media": {
      "main": [
        [
          {
            "node": "Publish Facebook",
            "type": "main",
            "index": 0
          },
          {
            "node": "Publish Instagram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false,
    "instanceId": "postifys-public-template"
  },
  "pinData": {},
  "versionId": "1",
  "tags": [
    {
      "name": "postifys"
    }
  ]
}