{
  "id": "OUOrcdfuTg2evIu0",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Simple Social: Instagram single image post with Facebook API",
  "tags": [
    {
      "id": "A0lOPfxLjZ8WmT1S",
      "name": "social",
      "createdAt": "2024-10-25T12:53:04.687Z",
      "updatedAt": "2024-10-25T12:53:04.687Z"
    },
    {
      "id": "jbFbEJV1RM8avhpH",
      "name": "shared on n8n",
      "createdAt": "2024-11-12T06:53:57.894Z",
      "updatedAt": "2024-11-12T06:53:57.894Z"
    }
  ],
  "nodes": [
    {
      "id": "ff1d20ec-2801-4c38-b71f-e0745b22a68c",
      "name": "Instagram prepare media",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        0,
        0
      ],
      "parameters": {
        "edge": "media",
        "node": "={{ $json.instagram_business_account_id }}",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "image_url",
                "value": "={{ $json.image_url }}"
              },
              {
                "name": "caption",
                "value": "={{ $json.instagram_post_caption }}"
              }
            ]
          }
        },
        "graphApiVersion": "v20.0",
        "httpRequestMethod": "POST"
      },
      "typeVersion": 1
    },
    {
      "id": "ae418ed8-47f7-4042-aa4d-abfbba12c580",
      "name": "Instagram publish media",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        540,
        -80
      ],
      "parameters": {
        "edge": "media_publish",
        "node": "={{ $('Instagram params').item.json.instagram_business_account_id }}",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "creation_id",
                "value": "={{ $json.id }}"
              }
            ]
          }
        },
        "graphApiVersion": "v20.0",
        "httpRequestMethod": "POST"
      },
      "typeVersion": 1
    },
    {
      "id": "b4bd1064-606d-4e31-8904-1f86a6f960a1",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -440,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b0fdc882-298c-4208-9935-d17f86b266dd",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -500,
        -77.62658687843901
      ],
      "parameters": {
        "height": 248.90655871788812,
        "content": "Choose the trigger you want for example trigger this workflow from another one"
      },
      "typeVersion": 1
    },
    {
      "id": "c395b60d-2423-415b-a6ef-1ce03c4d55a3",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -51,
        -140.74317176338093
      ],
      "parameters": {
        "color": 4,
        "width": 1329.8249455924943,
        "height": 430.4091991661993,
        "content": "Add your credential"
      },
      "typeVersion": 1
    },
    {
      "id": "5e872d97-b19f-4dce-91dc-e18aee3bcdca",
      "name": "Instagram params",
      "type": "n8n-nodes-base.set",
      "position": [
        -200,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "225df266-bf29-4415-b04c-2750cef4506a",
              "name": "image_url",
              "type": "string",
              "value": "Your image url"
            },
            {
              "id": "1e380c14-e908-4eeb-90e0-957a422829d0",
              "name": "instagram_business_account_id",
              "type": "string",
              "value": "Your instagram business id"
            },
            {
              "id": "f35e3093-1bff-4cc6-a6c4-909dca314cc7",
              "name": "instagram_post_caption",
              "type": "string",
              "value": "Here your Text of instagram post"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "256566bb-cb69-430e-ac94-ef2fd533f9ef",
      "name": "Node just for retrive id of instagram page",
      "type": "n8n-nodes-base.facebookGraphApi",
      "disabled": true,
      "position": [
        -240,
        -360
      ],
      "parameters": {
        "node": "=me",
        "options": {
          "fields": {
            "field": [
              {
                "name": "name"
              },
              {
                "name": "connected_instagram_account"
              }
            ]
          }
        },
        "graphApiVersion": "v20.0"
      },
      "typeVersion": 1
    },
    {
      "id": "52fa439f-a456-4d93-8f1e-b4c4141d32ee",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        -460
      ],
      "parameters": {
        "color": 5,
        "width": 318,
        "height": 289,
        "content": "You can use this node if you want to retrieve the instagram id. \n\nAdd it to the workflow ore use manually"
      },
      "typeVersion": 1
    },
    {
      "id": "2a72a21f-d3d7-4788-978b-8868f50f1108",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -248,
        -140
      ],
      "parameters": {
        "color": 3,
        "width": 188,
        "height": 310,
        "content": "Here we have all parameters for posting in instagram image url, caption and instagram business profile id"
      },
      "typeVersion": 1
    },
    {
      "id": "63f6b3b2-4aaa-487c-8eae-e6ed39d77ddc",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -500,
        180
      ],
      "parameters": {
        "color": 7,
        "width": 439.10253951549294,
        "height": 792,
        "content": "## Permissions\nPublishing relies on a combination of the following permissions. The exact combination depends on which endpoints your app uses. Refer to our endpoint references to determine which permissions each endpoint requires.\n\nads_management\nbusiness_management\ninstagram_basic\ninstagram_content_publish\npages_read_engagement\nIf your app will be used by app users who do not have a role on your app or a role in a Business that has claimed your app, you must request approval for each permission via App Review before non-role app users can grant them to your app.\n\n## Limitations\nJPEG is the only image format supported. Extended JPEG formats such as MPO and JPS are not supported.\nShopping tags are not supported.\nBranded content tags are not supported.\nFilters are not supported.\nPublishing to Instagram TV is not supported.\nFor additional limitations, refer to each endpoint's reference.\n\n## Rate Limit\nInstagram accounts are limited to 50 API-published posts within a rolling 24-hour period. Carousels count as a single post. This limit is enforced on the POST /{ig-user-id}/media_publish endpoint when attempting to publish a media container. We recommend that your app also enforce the publishing rate limit, especially if your app allows app users to schedule posts to be published in the future.\n\nTo check an Instagram Professional account's current rate limit usage, query the GET /{ig-user-id}/content_publishing_limit endpoint."
      },
      "typeVersion": 1
    },
    {
      "id": "336f8d20-ce1c-4097-91ba-1cf7cdd4f8d0",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -920,
        -320
      ],
      "parameters": {
        "color": 2,
        "width": 365.0530681548117,
        "height": 232.74275402436496,
        "content": "## Instagram single image Post Workflow with Facebook API\n\nthis is a workflow for post a single image on instagram\n\n\nP.S: if you want use instagram API you need just change the default url in node with graph.instagram.com"
      },
      "typeVersion": 1
    },
    {
      "id": "03ef7207-aa48-4c31-b5c2-91bb2436f68b",
      "name": "Instagram check status of media uploaded before",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        180,
        0
      ],
      "parameters": {
        "node": "={{ $json.id }}",
        "options": {
          "fields": {
            "field": [
              {
                "name": "id"
              },
              {
                "name": "status"
              },
              {
                "name": "status_code"
              }
            ]
          }
        },
        "graphApiVersion": "v20.0"
      },
      "typeVersion": 1
    },
    {
      "id": "3ba33f4a-e89b-40b1-98ec-c658a99777b8",
      "name": "If media status is finished",
      "type": "n8n-nodes-base.if",
      "position": [
        340,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "0304efee-33b2-499e-bad1-9238c1fc2999",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status_code }}",
              "rightValue": "FINISHED"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "fe72d3b7-4a8f-4b2d-9af7-d057da11fc88",
      "name": "Instagram check status of media published before",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        740,
        -80
      ],
      "parameters": {
        "node": "={{ $('Instagram check status of media uploaded before').item.json.id }}",
        "options": {
          "fields": {
            "field": [
              {
                "name": "id"
              },
              {
                "name": "status"
              },
              {
                "name": "status_code"
              }
            ]
          }
        },
        "graphApiVersion": "v20.0"
      },
      "typeVersion": 1
    },
    {
      "id": "4dd7347e-7a41-4cb0-ae2e-93a019ae4497",
      "name": "If media status is finished1",
      "type": "n8n-nodes-base.if",
      "position": [
        940,
        -80
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "0304efee-33b2-499e-bad1-9238c1fc2999",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status_code }}",
              "rightValue": "PUBLISHED"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "7dec948d-7ce0-4a68-acfb-cc9ab8e26f3e",
      "name": "Send Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        540,
        140
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "2c95dafb-f087-45ee-8e1f-3efdacd3ab6c",
      "name": "Send Email1",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1160,
        -120
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "c04c8441-6935-4bce-a358-4bba69d5b30b",
      "name": "Send Email2",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1160,
        40
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "74f0c188-03ce-49a6-9004-ee0720f9e4df",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        300
      ],
      "parameters": {
        "color": 3,
        "height": 102.11100456713636,
        "content": "You can send email for unsuccessful upload or what you want, you can trigger another workflow or another node"
      },
      "typeVersion": 1
    },
    {
      "id": "127813b3-2cfd-40b9-a4d9-c88c5927f4f1",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1340,
        40
      ],
      "parameters": {
        "color": 3,
        "height": 112.31608359812239,
        "content": "You can send email for unsuccessful publishing or what you want, you can trigger another workflow or another node"
      },
      "typeVersion": 1
    },
    {
      "id": "f156294d-cf7b-4638-ac00-87ea30f846a0",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1340,
        -120
      ],
      "parameters": {
        "color": 3,
        "height": 112.31608359812239,
        "content": "You can send email for successfull publishing or what you want, you can trigger another workflow or another node"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ea4a1249-35d3-4037-a4f9-451ccc2ec698",
  "connections": {
    "Instagram params": {
      "main": [
        [
          {
            "node": "Instagram prepare media",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Instagram prepare media": {
      "main": [
        [
          {
            "node": "Instagram check status of media uploaded before",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Instagram publish media": {
      "main": [
        [
          {
            "node": "Instagram check status of media published before",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If media status is finished": {
      "main": [
        [
          {
            "node": "Instagram publish media",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If media status is finished1": {
      "main": [
        [
          {
            "node": "Send Email1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Email2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Instagram params",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Instagram check status of media uploaded before": {
      "main": [
        [
          {
            "node": "If media status is finished",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Instagram check status of media published before": {
      "main": [
        [
          {
            "node": "If media status is finished1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}