{
  "id": "dF5TuCrFNhFKX7rc",
  "name": "2 Auto-post images from Google Drive to Instagram",
  "tags": [],
  "nodes": [
    {
      "id": "411b26ce-7f81-41ae-a004-cf55dc3480d8",
      "name": "Daily Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -4928,
        64
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "edfa62f5-8799-456d-ac64-7c2a81c7ef1b",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -4704,
        64
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "googleDriveFolderId",
              "type": "string",
              "value": "<YOUR-DRIVE-ID>"
            },
            {
              "id": "id-2",
              "name": "googleSheetId",
              "type": "string",
              "value": "<YOUR-SHEET-ID>"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "f37e8c92-2c6f-4d2c-b6fa-089f11bbc33a",
      "name": "Get Next Scheduled Post",
      "type": "n8n-nodes-base.googleSheets",
      "onError": "continueErrorOutput",
      "position": [
        -4480,
        64
      ],
      "parameters": {
        "options": {
          "returnFirstMatch": true,
          "dataLocationOnSheet": {
            "values": {
              "range": "A:G",
              "rangeDefinition": "specifyRangeA1"
            }
          }
        },
        "filtersUI": {
          "values": [
            {
              "lookupValue": "Ready to Post",
              "lookupColumn": "status"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1ZpdeQ7-9Bq1-TUTEZxjtCe3TLhk5s_2hZN1ZosP15Hk/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.googleSheetId }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "7956b260-05d1-43e9-8deb-d206c9ca5edc",
      "name": "Check If Post Found",
      "type": "n8n-nodes-base.if",
      "position": [
        -4256,
        64
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "id-1",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $input.all().length }}",
              "rightValue": 0
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "e9c861a8-af61-4557-a0ad-079010923187",
      "name": "Download Image from Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -3584,
        -32
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {
          "binaryPropertyName": "data"
        },
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "f1e62c78-d3e4-4f3e-844b-d49b8445b8a5",
      "name": "Prepare AI Context",
      "type": "n8n-nodes-base.set",
      "position": [
        -2912,
        -32
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "image_public_url",
              "type": "string",
              "value": "={{ $json.images[0].source }}"
            },
            {
              "id": "b14a653e-27ab-4043-817f-66127128d845",
              "name": "image_facebook_id",
              "type": "string",
              "value": "={{ $('Upload Image to Facebook').item.json.id }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "cd4ad534-1a26-464c-9af6-e0f0b66a05ee",
      "name": "Generate Caption and Hashtags",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "onError": "continueErrorOutput",
      "position": [
        -2688,
        -32
      ],
      "parameters": {
        "text": "=Generate platform-specific social media content for Instagram, Facebook, and Pinterest in a single JSON object.\n\nPost Inputs:\n- Topic: {{ $('Get Next Scheduled Post').item.json.Topic }}\n- Angle / Question: {{ $('Get Next Scheduled Post').item.json['Question / Angle'] }}\n\nBrand & Product Context:\n{\n  \"client_name\": \"<COMPANY-NAME>\",\n  \"industry\": \"<COMPANY-INDUSTRY>\",\n  \"product_source_url\": \"<COMPANY-INDUSTRY>\",\n  \"product_type\": \"<PRODUCT-TYPE>\",\n  \"brand_tone\": \"<BRAND-TONE>\"\n}\n\nOUTPUT FORMAT (JSON ONLY):\n\n{\n  \"instagram\": {\n    \"post_content\": \"<string>\",\n    \"hashtags\": [\"#...\", \"#...\"]\n  }\n}\n\nRules:\n- Captions MUST be unique per platform.\n- Captions MUST NOT include hashtags.\n- Reference the brand/product subtly to maintain natural engagement.\n- Pinterest captions should be SEO-rich and benefit-driven.\n- Use trending keywords only if they fit naturally.\n- Return ONLY the JSON structure \u2014 no commentary.",
        "options": {
          "systemMessage": "=You are a senior Social Media Content Strategist specializing in platform-specific content for Instagram.\n\nYour job:\n- Create DIFFERENT captions for each platform.\n- Keep captions and hashtags separate always.\n- Reflect the brand, product purpose, and industry in subtle, natural ways.\n- Adapt tone & length per platform:\n  \u2022 Instagram \u2192 emotional, modern, scroll-stopping (125\u2013300 chars)\n- Hashtag rules:\n  \u2022 Instagram: 8\u201312 high-performing + niche hashtags\n- Use trending keywords when provided.\n- Do NOT include hashtags inside post_content.\n- Do NOT include URLs inside Instagram captions.\n- No CTA is required unless naturally relevant.\n- Do NOT include any links inside post content or hashtags\n- Do NOT include Brand name at the end (no trailing signature)\n- ALWAYS return valid JSON ONLY. No extra text or markdown."
        },
        "promptType": "define"
      },
      "notesInFlow": false,
      "typeVersion": 3
    },
    {
      "id": "585b4c1f-d2d0-40f3-bc35-b24bed8c4110",
      "name": "Post to Instagram",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        -2336,
        -32
      ],
      "parameters": {
        "edge": "media",
        "node": "<PAGE-ID>",
        "hostUrl": "=graph.facebook.com",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "caption",
                "value": "={{ JSON.parse($node[\"Generate Caption and Hashtags\"].json[\"output\"]).instagram.post_content }}\n\n{{ JSON.parse($node[\"Generate Caption and Hashtags\"].json[\"output\"]).instagram.hashtags }}"
              },
              {
                "name": "image_url",
                "value": "={{ $('Prepare AI Context').item.json.image_public_url }}"
              }
            ]
          }
        },
        "graphApiVersion": "v23.0",
        "httpRequestMethod": "POST"
      },
      "retryOnFail": true,
      "typeVersion": 1
    },
    {
      "id": "05e8c0cc-4d38-4460-bcf9-fac6c76b6e2b",
      "name": "Update Sheet - Posted",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1440,
        -128
      ],
      "parameters": {
        "columns": {
          "value": {
            "row_number": "={{ $node[\"Get Next Scheduled Post\"].json.row_number }}",
            "Instagram_Status": "Posted",
            "Instagram Post Content + hashtags": "={{ JSON.parse($node[\"Generate Caption and Hashtags\"].json[\"output\"]).instagram.post_content }}  \n\n{{ JSON.parse($node[\"Generate Caption and Hashtags\"].json[\"output\"]).instagram.hashtags }}"
          },
          "schema": [
            {
              "id": "Date",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Topic",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Topic",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Question / Angle",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Question / Angle",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "product url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "product url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Instagram Post Content + hashtags",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Instagram Post Content + hashtags",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Instagram_Status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Instagram_Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Facebook Post Content + hashtags",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Facebook Post Content + hashtags",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Facebook Status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Facebook Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Pinterest Post Content + hashtags",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Pinterest Post Content + hashtags",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Pinterest Status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Pinterest Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.googleSheetId }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "2283eea1-e7c4-400f-8429-f8ba8f0151cd",
      "name": "Update Sheet - Failed",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1440,
        64
      ],
      "parameters": {
        "columns": {
          "value": {
            "row_number": "={{ $node[\"Get Next Scheduled Post\"].json.row_number }}",
            "Instagram_Status": "Failed"
          },
          "schema": [
            {
              "id": "Date",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Topic",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Topic",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Question / Angle",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Question / Angle",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "product url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "product url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Instagram Post Content + hashtags",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Instagram Post Content + hashtags",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Instagram_Status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Instagram_Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Facebook Post Content + hashtags",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Facebook Post Content + hashtags",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Facebook Status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Facebook Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Pinterest Post Content + hashtags",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Pinterest Post Content + hashtags",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Pinterest Status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Pinterest Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Workflow Configuration').first().json.googleSheetId }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "d045e70d-3996-47cd-87bd-4d042beef5ce",
      "name": "No More Posts",
      "type": "n8n-nodes-base.code",
      "position": [
        -4032,
        160
      ],
      "parameters": {
        "jsCode": "return [\n  {\n    json: {\n      message: 'No posts scheduled for today or all posts completed'\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "ad3cde3f-4f03-4555-b0a3-02b86f519ff1",
      "name": "Check Post Success",
      "type": "n8n-nodes-base.if",
      "position": [
        -1664,
        -32
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "id-1",
              "operator": {
                "type": "boolean",
                "operation": "equals"
              },
              "leftValue": "={{ $node[\"Post to Instagram\"].json.id ? true : false }}",
              "rightValue": "true"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "383946f3-de16-4a68-946d-bbfde248f8f6",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -2616,
        192
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini",
          "cachedResultName": "gpt-5-mini"
        },
        "options": {},
        "builtInTools": {
          "webSearch": {
            "searchContextSize": "medium"
          }
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "084b6a64-2e60-4111-9fee-d1ec5e6ed104",
      "name": "Search files and folders",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -3808,
        -32
      ],
      "parameters": {
        "limit": 1,
        "filter": {
          "folderId": {
            "__rl": true,
            "mode": "list",
            "value": "root",
            "cachedResultUrl": "https://drive.google.com/drive",
            "cachedResultName": "/ (Root folder)"
          }
        },
        "options": {
          "fields": [
            "id",
            "name"
          ]
        },
        "resource": "fileFolder",
        "queryString": "={{ $('Get Next Scheduled Post').item.json.Date + '.*' }}"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "9cb11f16-7be3-4ebe-a8b6-e0c1cb44f258",
      "name": "6b. Wait for Container Processing",
      "type": "n8n-nodes-base.wait",
      "position": [
        -2112,
        -32
      ],
      "parameters": {},
      "retryOnFail": true,
      "typeVersion": 1.1
    },
    {
      "id": "2ea21030-ab1b-4e40-964e-c1b046dd8c10",
      "name": "Get Public URL From Facebook",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -3136,
        -32
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v19.0/{{ $json.id }}?fields=images&access_token={{ $('Get Access Token from Facebook').item.json.data[0].access_token }}",
        "options": {}
      },
      "typeVersion": 4.3
    },
    {
      "id": "eb97f546-c250-4118-ac30-60cc9ede1753",
      "name": "Upload Image to Facebook",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -3360,
        -32
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/v24.0/<YOUR-ACCOUNT-D>/photos",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "data",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            },
            {
              "name": "published",
              "value": "false"
            },
            {
              "name": "access_token",
              "value": "={{ $('Get Access Token from Facebook').item.json.data[0].access_token }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "ccc90fb4-07a7-4d6f-b799-23d8d788073c",
      "name": "Get Access Token from Facebook",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -4032,
        -32
      ],
      "parameters": {
        "url": "=https://graph.facebook.com/me/accounts?access_token=<YOUR-ACCESS-TOKEN>",
        "options": {}
      },
      "typeVersion": 4.3
    },
    {
      "id": "638ed2d8-46a8-472f-8f97-cef70033ff93",
      "name": "Publish Post to Instagram",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        -1888,
        -32
      ],
      "parameters": {
        "edge": "media_publish",
        "node": "=<PAGE-ID>",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "creation_id",
                "value": "={{ $json.id }}"
              }
            ]
          }
        },
        "graphApiVersion": "v22.0",
        "httpRequestMethod": "POST"
      },
      "retryOnFail": true,
      "typeVersion": 1
    },
    {
      "id": "2513d193-4f34-49c6-b0fb-98f62ee7f422",
      "name": "\ud83d\udcc5 WORKFLOW START",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -5014,
        -8
      ],
      "parameters": {
        "color": 5,
        "width": 268,
        "height": 232,
        "content": "\ud83d\udcc5 WORKFLOW START\n\n\n\n\n\n\n\n\n\n\n\nThis trigger works every 1 hour "
      },
      "typeVersion": 1
    },
    {
      "id": "8a27d585-5b4d-4b68-92dc-4289ba11a8c2",
      "name": "\ud83d\udd10 AUTHENTICATION",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -5808,
        -288
      ],
      "parameters": {
        "width": 652,
        "height": 904,
        "content": "\ud83d\udd10 AUTHENTICATION\n\nRetrieves Facebook Page access token needed for Instagram API calls. This token is used throughout the workflow for uploading images and posting.\n\n\ud83d\udcc5 WORKFLOW START\n\nTriggers every hour to check for scheduled posts. Workflow Configuration stores Google Sheet and Drive IDs for easy management.\n\n\u2705 STATUS UPDATE\n\nUpdates Google Sheet based on posting result:\n- SUCCESS: Sets Instagram_Status to \"Posted\" and saves the generated content\n- FAILURE: Sets Instagram_Status to \"Failed\" for manual review\n\n\ud83d\udcf8 IMAGE PROCESSING\n\n1. Searches Google Drive for image file matching the post date\n2. Downloads the image as binary data\n3. Uploads to Facebook (unpublished) to get a public URL\n4. Retrieves the public URL needed for Instagram posting\n\n\ud83d\udcf1 INSTAGRAM POSTING\n\n1. Creates Instagram media container with image URL and caption\n2. Waits 5 seconds for Facebook to process the container\n3. Publishes the post to Instagram\n4. Checks if posting was successful\n\n\ud83d\udccb FETCH POST DATA\n\nSearches Google Sheet for posts with status \"Ready to Post\". Returns the first matching row with Topic, Date, and Question/Angle. If no posts found, workflow ends gracefully.\n\n\ud83e\udd16 AI CONTENT GENERATION\n\nUses OpenAI to generate platform-specific Instagram captions and hashtags based on:\n- Topic from Google Sheet\n- Question/Angle from Google Sheet\n- Brand context (company, industry, tone)\n\nOutputs JSON with post_content and hashtags array."
      },
      "typeVersion": 1
    },
    {
      "id": "bc8cdb33-3e06-47ce-80fb-0d1098596198",
      "name": "\ud83e\udd16 AI CONTENT GENERATION",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2368,
        224
      ],
      "parameters": {
        "color": 6,
        "width": 340,
        "height": 112,
        "content": "Optional \n\nAdd your Facebook Credentials in the another loop to make agent post in both Instagram and Facebook "
      },
      "typeVersion": 1
    },
    {
      "id": "b27d1269-763d-4453-9081-ad003944efac",
      "name": "\ud83e\udd16 AI CONTENT GENERATION1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3456,
        160
      ],
      "parameters": {
        "color": 6,
        "width": 340,
        "content": "Public URL\n\nIt can be from any public URL from AWS S3, imgbb, etc..\n\nI have used Facebook for usecase to avoid errors from external services."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "cce44ce8-912e-4740-afbf-4589b1c13b40",
  "connections": {
    "Daily Trigger": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Caption and Hashtags",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Post to Instagram": {
      "main": [
        [
          {
            "node": "6b. Wait for Container Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Post Success": {
      "main": [
        [
          {
            "node": "Update Sheet - Posted",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Update Sheet - Failed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare AI Context": {
      "main": [
        [
          {
            "node": "Generate Caption and Hashtags",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Post Found": {
      "main": [
        [
          {
            "node": "Get Access Token from Facebook",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No More Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Get Next Scheduled Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Next Scheduled Post": {
      "main": [
        [
          {
            "node": "Check If Post Found",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search files and folders": {
      "main": [
        [
          {
            "node": "Download Image from Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Image to Facebook": {
      "main": [
        [
          {
            "node": "Get Public URL From Facebook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Image from Drive": {
      "main": [
        [
          {
            "node": "Upload Image to Facebook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Publish Post to Instagram": {
      "main": [
        [
          {
            "node": "Check Post Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Public URL From Facebook": {
      "main": [
        [
          {
            "node": "Prepare AI Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Caption and Hashtags": {
      "main": [
        [
          {
            "node": "Post to Instagram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Access Token from Facebook": {
      "main": [
        [
          {
            "node": "Search files and folders",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6b. Wait for Container Processing": {
      "main": [
        [
          {
            "node": "Publish Post to Instagram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}