{
  "id": "i0N2bi0rlVr70bGW",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "AI Auto-Reply to Instagram Comments with Gemini & Google Sheet Tracker",
  "tags": [],
  "nodes": [
    {
      "id": "33106b0f-2926-4c7c-9cc0-ae1495f51493",
      "name": "Sticky Note - Configure Node",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3600,
        4816
      ],
      "parameters": {
        "color": 6,
        "width": 378,
        "height": 380,
        "content": "\u2699\ufe0f **CONFIGURE BEFORE RUNNING**\n\nOpen \"Configure Post & Message\" node and fill in:\n\n1. **postUrl** \u2192 Instagram post URL\n   Example: https://www.instagram.com/p/ABC123DEF/\n2. **instaId** \u2192 Instagram Business Account ID\n   (Find in Facebook Business Manager)\n3. **brandName** \u2192 Your business name (e.g., \"BrewNest Coffee\")\n4. **brandTone** \u2192 Your brand voice (e.g., \"Warm and witty\")\n5. **googleSheetUrl** \u2192 Your Google Sheet Url\n\n\u26a0\ufe0f Ensure Google Sheets, Facebook Graph, and Google Gemini credentials are connected!"
      },
      "typeVersion": 1
    },
    {
      "id": "af7a0c59-74c4-4490-8fa7-173830e1b318",
      "name": "Sticky Note - Google Sheets Setup",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4848,
        4768
      ],
      "parameters": {
        "color": 5,
        "width": 410,
        "height": 436,
        "content": "\ud83d\udccb **GOOGLE SHEET SETUP**\n\nBoth \"Read\" and \"Record\" nodes use the same sheet.\n\n**Step 1:** Create a new blank Google Sheet\n\n**Step 2:** Add these headers in Row 1:\n```\ncomment_id | username | comment | reply_id | reply | comments_timestamp | post_url | reply_timestamps\n```\n\n**Step 3:** Copy your Google Sheet URL (format: docs.google.com/spreadsheets/d/[SHEET_ID]/) and paste it in the Configuration node.\n\n**Step 4:** Paste Sheet URL in Configuration node\n\u2713 Ready to track comments!\n\n**Note:** Both Read/Record nodes default to tab name **\"Sheet1\"**. If your sheet tab has a different name, update `sheetName` in both nodes."
      },
      "typeVersion": 1
    },
    {
      "id": "74e63307-f20d-4dd5-a083-2f30f62a3d7a",
      "name": "Template Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2816,
        4208
      ],
      "parameters": {
        "width": 668,
        "height": 1040,
        "content": "## \ud83d\udcf8 Instagram Auto-Reply & Tracking\n\n### Who it's for\nSocial media managers, creators, and business owners who need to automate engagement on specific high-traffic Instagram posts.\n\n### What it does\nAutomatically monitors a specific Instagram post, generates context-aware, on-brand replies using AI (Gemini), posts the reply, and logs interactions in Google Sheets to prevent duplicates.\n\n### How it works\n1. **Fetch:** Pulls recent media and comments via Facebook Graph API.\n2. **Deduplicate:** Filters out users already logged in Google Sheets.\n3. **AI Generate:** Gemini 2.5 Flash analyzes the post caption and the user's comment to craft a personalized reply matching your brand tone.\n4. **Action:** Posts the reply and logs the success/failure to Sheets.\n\n### How to set up\n1. **Connect:** Authenticate your Facebook Graph API and Google Sheets credentials.\n2. **Sheet:** Create a Google Sheet with Row 1 headers: `comment_id`, `username`, `comment`, `reply_id`, `reply`, `comments_timestamp`, `post_url`, `reply_timestamps`.\n3. **Config:** Update the **Configure Post & Message** node with your `postUrl`, `instaId`, `brandName`, `brandTone` and `googleSheetUrl`.\n\n\n### Requirements\n- **n8n Version:** 2.11.3+.\n- **Instagram:** Business Account connected to a Facebook Page.\n- **Credentials:** Facebook Graph API, Google Sheets OAuth2, Google Gemini API. *(Note: For Gemini, use the \"Google Gemini(PaLM) Api account\" credential type to input your AI Studio key).* \n\n### How to customize\n- **Frequency:** Adjust the **Schedule Trigger** interval (currently set to every 15 minutes).\n- **Filtering:** Modify the **Filter and Get Post ID** node logic if you wish to monitor multiple posts simultaneously.\n\n### \ud83d\udce6 Version Info\n- **Facebook Graph API:** v23.0."
      },
      "typeVersion": 1
    },
    {
      "id": "a38e0e39-e6d6-4890-8bc6-ee3006cce87e",
      "name": "Zone ",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3504,
        4208
      ],
      "parameters": {
        "color": 6,
        "width": 517,
        "height": 635,
        "content": "## 1. \u2699\ufe0f Trigger & Config\nSet your post details and schedule here.\n\n**Manual or Scheduled**\n- Manual Trigger: Click to run anytime\n- Schedule Trigger: Auto-runs every 15 min\n\n**Configuration:**\n- Set Instagram post URL\n- Set Instagram Account ID\n- Brand Name & Tone (Guides the AI)\n- Set Google Sheet URL"
      },
      "typeVersion": 1
    },
    {
      "id": "9aa0577b-d23a-422e-8bb1-30dbad86e2d7",
      "name": "Zone 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4048,
        4208
      ],
      "parameters": {
        "color": 4,
        "width": 706,
        "height": 626,
        "content": "## 2. \ud83d\udce5 Ingestion\nRetrieves your posts and all current comments.\n\n**Fetches from Instagram:**\n1. Your recent media posts\n2. All comments on target post\n3. Comment details (text, author, timestamp)\n\n**Uses:**\n- Facebook Graph API"
      },
      "typeVersion": 1
    },
    {
      "id": "24463236-ceb3-49ea-a9e1-a1d1513b898f",
      "name": "Zone 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4784,
        4208
      ],
      "parameters": {
        "color": 5,
        "width": 600,
        "height": 626,
        "content": "## 3. \ud83e\udde0 Deduplication\nCompares live comments against your Google Sheet history.\n\n**Compares:**\n- New comments from Instagram\n- Already-contacted list (Google Sheet)\n\n**Result:**\nOnly NEW comment IDs pass forward\n(Prevents duplicate replies)\n\n**Data Source:**\nGoogle Sheets history of all replies sent\n\n\ud83d\udc49 This is why duplicate protection works!"
      },
      "typeVersion": 1
    },
    {
      "id": "affb3ada-bf98-4804-9805-3090d5935c37",
      "name": "Zone 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5424,
        4208
      ],
      "parameters": {
        "color": 2,
        "width": 980,
        "height": 766,
        "content": "## 4. \ud83d\udce4 Execution\nDrafts and sends the custom reply.\n\n**For Each NEW Comment:**\n1. Gemini AI crafts a context-aware reply based on brand tone.\n2. Code node sanitizes the AI output.\n3. Post the reply via Facebook Graph API.\n4. Route to Success/Error logging.\n\n**Uses:** Facebook Graph API\n\n\ud83d\udc49 One reply per new comment only!"
      },
      "typeVersion": 1
    },
    {
      "id": "d7f2fe00-d6c2-4c3e-9392-c9043efafd67",
      "name": "Zone 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6432,
        4208
      ],
      "parameters": {
        "color": 7,
        "width": 752,
        "height": 766,
        "content": "## 5. \ud83d\udcca Reporting\nUpdates the sheet and generates a status report.\n\n**Logs to Google Sheet:**\n- Comment ID\n- Username\n- Message sent\n- Timestamps\n- Success/failure status\n\n**Generates Summary:**\n- Comments found\n- Replies sent\n- Failures (if any)\n\n\ud83d\udc49 Check Execution logs for details"
      },
      "typeVersion": 1
    },
    {
      "id": "16988bb4-23c1-4b93-938d-d52729a3f72b",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        3552,
        4512
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "382106e4-a807-4f6e-ab34-4b2f4097b3d9",
      "name": "Schedule Trigger (Every 15 min)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        3552,
        4656
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 15
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b62f4f0b-be5d-4140-9141-08ad20298fb8",
      "name": "Configure Post & Message",
      "type": "n8n-nodes-base.set",
      "position": [
        3840,
        4576
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "postUrl",
              "name": "postUrl",
              "type": "string",
              "value": "PASTE_YOUR_INSTA_POST_URL_HERE"
            },
            {
              "id": "instaId",
              "name": "instaId",
              "type": "string",
              "value": "PASTE_YOUR_INSTAGRAM_ID_HERE"
            },
            {
              "id": "1ec61ea6-315f-46a7-86e0-5bcf7b7bed17",
              "name": "brandName",
              "type": "string",
              "value": "PASTE_YOUR_BRAND_NAME_HERE"
            },
            {
              "id": "73587ddb-9e0c-4245-9c3c-a2143f59ed81",
              "name": "brandTone",
              "type": "string",
              "value": "PASTE_YOUR_BRAND_TONE_HERE"
            },
            {
              "id": "10933cb0-0f8f-4569-87e9-55e8e6b2562f",
              "name": "googleSheetUrl",
              "type": "string",
              "value": "PASTE_GOOGLE_SHEET_URL_HERE"
            }
          ]
        }
      },
      "typeVersion": 3.3
    },
    {
      "id": "640796b5-8d99-414b-8936-aea2a4097615",
      "name": "Get Instagram Posts",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        4080,
        4576
      ],
      "parameters": {
        "edge": "media",
        "node": "={{ $json.instaId }}",
        "options": {
          "fields": {
            "field": [
              {
                "name": "id,shortcode,permalink,caption"
              }
            ]
          }
        },
        "graphApiVersion": "v23.0"
      },
      "credentials": {
        "facebookGraphApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fba8e5ed-3249-4de8-a7e6-c6c64ec3318f",
      "name": "Filter and Get Post ID",
      "type": "n8n-nodes-base.code",
      "position": [
        4368,
        4576
      ],
      "parameters": {
        "jsCode": "const allPosts = $input.all()[0]?.json?.data || [];\nconst targetUrl = $('Configure Post & Message').first()?.json?.postUrl;\nconst post = allPosts.find(p => p.permalink === targetUrl);\nif (!post) throw new Error('Post URL not found in recent media.');\nreturn { json: post };"
      },
      "typeVersion": 2
    },
    {
      "id": "c43d9436-acb9-41a1-9a83-fdfd75de31a4",
      "name": "Get All Comments",
      "type": "n8n-nodes-base.facebookGraphApi",
      "position": [
        4608,
        4576
      ],
      "parameters": {
        "edge": "comments",
        "node": "={{ $json.id }}",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "fields",
                "value": "id,text,username,timestamp"
              },
              {
                "name": "limit",
                "value": "100"
              }
            ]
          }
        },
        "graphApiVersion": "v23.0"
      },
      "credentials": {
        "facebookGraphApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "47f03074-0d53-4b06-8961-19f9a8f80a1f",
      "name": "Read Contacted Users",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        4896,
        4576
      ],
      "parameters": {
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Configure Post & Message').first().json.googleSheetUrl }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4,
      "alwaysOutputData": true
    },
    {
      "id": "ac18a543-beb0-4141-9850-272e36cccaa0",
      "name": "Filter New Comments",
      "type": "n8n-nodes-base.code",
      "position": [
        5136,
        4576
      ],
      "parameters": {
        "jsCode": "const comments = $(\"Get All Comments\").first().json.data || [];\nconst contacted = $input.all().map(i => String(i.json.comment_id || '').trim());\nconst newOnes = comments.filter(c => !contacted.includes(String(c.id).trim()));\n\nif (newOnes.length === 0) return [{ json: { noNewComments: true } }];\nreturn newOnes.map(c => ({ json: { \n  commentId: c.id,\n  comment: c.text,\n  username: c.username, \n  timestamp: c.timestamp, \n  postUrl: $('Configure Post & Message').first().json.postUrl\n}}));"
      },
      "typeVersion": 2
    },
    {
      "id": "bee8a6ac-655d-4f6e-8bd4-7dc1f230b914",
      "name": "Check If Has New Comments",
      "type": "n8n-nodes-base.if",
      "position": [
        5344,
        4576
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "692b6096-3e4d-439e-9ab4-4b04c8edcb6e",
              "operator": {
                "type": "boolean",
                "operation": "notEqual"
              },
              "leftValue": "={{ $json.noNewComments }}",
              "rightValue": true
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "2d920a4f-bf18-45c9-b25c-2cc84bd7129d",
      "name": "Reply on Comments",
      "type": "n8n-nodes-base.facebookGraphApi",
      "onError": "continueErrorOutput",
      "position": [
        6576,
        4528
      ],
      "parameters": {
        "edge": "replies",
        "node": "={{ $('Loop Over Items').item.json.commentId }}",
        "options": {
          "queryParameters": {
            "parameter": [
              {
                "name": "message",
                "value": "={{ $json.reply }}"
              }
            ]
          }
        },
        "graphApiVersion": "v23.0",
        "httpRequestMethod": "POST"
      },
      "credentials": {
        "facebookGraphApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e4b10499-1383-4a6c-9c8a-79a81b212345",
      "name": "API Error Fallback",
      "type": "n8n-nodes-base.noOp",
      "position": [
        6576,
        4704
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "aa3f2364-3784-41de-95c2-4edfc6fb3424",
      "name": "Skip (No New Comments)",
      "type": "n8n-nodes-base.noOp",
      "position": [
        5712,
        4736
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f5d9fa2f-1958-4dea-b073-19adb843d002",
      "name": "Record Contacted User",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        7040,
        4480
      ],
      "parameters": {
        "columns": {
          "value": {
            "reply": "={{ $('Parse AI Reply').item.json.reply }}",
            "comment": "={{ $('Loop Over Items').item.json.comment }}",
            "post_url": "={{ $('Loop Over Items').item.json.postUrl }}",
            "reply_id": "={{ $('Reply on Comments').item?.json?.id || 'API Error' }}",
            "username": "={{ $('Loop Over Items').item.json.username }}",
            "comment_id": "={{ $('Loop Over Items').item.json.commentId }}",
            "reply_timestamps": "={{ new Date().toISOString() }}",
            "comments_timestamp": "={{ $('Loop Over Items').item.json.timestamp }}"
          },
          "schema": [
            {
              "id": "comment_id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "comment_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "username",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "username",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "comment",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "comment",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "reply_id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "reply_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "reply",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "reply",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "comments_timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "comments_timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "post_url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "post_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "reply_timestamps",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "reply_timestamps",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Configure Post & Message').first().json.googleSheetUrl }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4
    },
    {
      "id": "9bc15bdc-8530-4d19-bcad-e3839752f7af",
      "name": "Generate Summary",
      "type": "n8n-nodes-base.code",
      "position": [
        6592,
        4768
      ],
      "parameters": {
        "jsCode": "const loopItems = $('Loop Over Items').all();\nconst processed = loopItems ? loopItems.length : 0;\nreturn [{ json: {\n  message: 'Monitoring cycle complete.',\n  commentsProcessed: processed,\n  timestamp: new Date().toISOString()\n} }];"
      },
      "typeVersion": 2
    },
    {
      "id": "4d800ee1-0d73-4189-93f2-60e7a04925c6",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        5616,
        4528
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "d505e748-087e-4c30-a457-7f5e242e1a41",
      "name": "Parse AI Reply",
      "type": "n8n-nodes-base.code",
      "position": [
        6256,
        4432
      ],
      "parameters": {
        "jsCode": "const items = $input.item.json;\nconst text = items.content?.parts?.[0]?.text || items.text || '';\nconst cleanJson = text.replace(/```json|```/g, \"\").trim();\ntry {\n  const response = JSON.parse(cleanJson);\n  return { json: response };\n} catch(e) {\n  return { json: { reply: '', parseError: true, rawText: text } };\n}"
      },
      "typeVersion": 2
    },
    {
      "id": "a237213e-5f92-48aa-bbc3-d099678af704",
      "name": "Generate Reply with AI",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        5904,
        4432
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.5-flash",
          "cachedResultName": "models/gemini-2.5-flash"
        },
        "options": {
          "temperature": 0.7,
          "systemMessage": "You are an Instagram community manager AI. Your job is to generate friendly, on-brand replies to Instagram comments.  Always respond in strict JSON format with no extra text, markdown, or preamble.  Return this exact structure: {   \"reply\": \"string\",   \"tone\": \"friendly \n promotional \n empathetic \n informational \n humorous\",   \"intent_detected\": \"string\",   \"suggested_action\": \"none \n send_dm \n escalate_to_human \n add_to_faq\",   \"confidence\": 0.0 to 1.0,   \"tags\": [\"string\"] }  Rules: - \"reply\" must be under 220 characters (Instagram limit consideration). - \"reply\" must feel human, warm, and natural \u2014 no robotic phrasing. - Use relevant emojis sparingly (max 2). - Never make up pricing, policies, or promises. - If a comment is negative or a complaint, set suggested_action to \"escalate_to_human\". - If a comment asks a repeated FAQ-style question, set suggested_action to \"add_to_faq\". - \"intent_detected\" should briefly summarize what the commenter wants, e.g. \"asking about price\", \"expressing excitement\", \"leaving a complaint\". - \"tags\" should include relevant labels like: [\"complaint\", \"shipping\", \"product_question\", \"compliment\", \"spam\", \"urgent\"].",
          "maxOutputTokens": 8192
        },
        "messages": {
          "values": [
            {
              "content": "=Generate a reply for the following Instagram comment.\n\nBrand: {{ $('Configure Post & Message').first().json.brandName }}\nBrand tone/personality: {{ $('Configure Post & Message').first().json.brandTone }}\nPost context: {{ $('Filter and Get Post ID').first().json.caption }}\nComment: {{ $json.comment }}\n\nRespond only with the JSON object."
            }
          ]
        },
        "builtInTools": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "1958631e-abbc-4b7d-a970-256bebf6d262",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        6784,
        4528
      ],
      "parameters": {
        "amount": 1
      },
      "typeVersion": 1.1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "errorWorkflow": "YOUR_ERROR_WORKFLOW_ID_HERE",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "3a04b8b2-dfa8-4a69-92b6-09f79c2e7372",
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Record Contacted User",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Configure Post & Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI Reply": {
      "main": [
        [
          {
            "node": "Reply on Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Generate Summary",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate Reply with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get All Comments": {
      "main": [
        [
          {
            "node": "Read Contacted Users",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reply on Comments": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "API Error Fallback",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "API Error Fallback": {
      "main": [
        [
          {
            "node": "Record Contacted User",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter New Comments": {
      "main": [
        [
          {
            "node": "Check If Has New Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Instagram Posts": {
      "main": [
        [
          {
            "node": "Filter and Get Post ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Contacted Users": {
      "main": [
        [
          {
            "node": "Filter New Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Record Contacted User": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter and Get Post ID": {
      "main": [
        [
          {
            "node": "Get All Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Reply with AI": {
      "main": [
        [
          {
            "node": "Parse AI Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Skip (No New Comments)": {
      "main": [
        [
          {
            "node": "Generate Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure Post & Message": {
      "main": [
        [
          {
            "node": "Get Instagram Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Has New Comments": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Skip (No New Comments)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger (Every 15 min)": {
      "main": [
        [
          {
            "node": "Configure Post & Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}