{
  "name": "Viral Instagram Bot - Share",
  "nodes": [
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        -2224,
        1120
      ],
      "id": "5d7b5e06-0fc3-4d69-a0a9-f3b8debdf8f4",
      "name": "Telegram Trigger",
      "webhookId": "9cc1d0b2-8103-4c95-a5ce-4f38eebc5850",
      "credentials": {
        "telegramApi": {
          "id": "f1eUsYZE8aVbaosh",
          "name": "Instagram Viral Bot"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://api.apify.com/v2/acts/apify~instagram-profile-scraper/run-sync-get-dataset-items?token=YOUR_API_KEY",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n    \"includeAboutSection\": false,\n    \"usernames\": [{{ $json.usernames }}]\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.3,
      "position": [
        512,
        800
      ],
      "id": "30e296b8-c735-40ef-9e37-2cbbe1332533",
      "name": "HTTP Request1"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk",
          "mode": "list",
          "cachedResultName": "Instagram Viral Bot",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Enter Competitor Here",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit#gid=0"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        112,
        800
      ],
      "id": "4b648476-e653-49a9-8185-f96568822afa",
      "name": "Get Competitor Names1",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "EueoYZPAJ7p7Lu1l",
          "name": "Artem@Altari"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const usernames = $input.all().map(item => `\"${item.json.Username.replace('\\n','')}\"`);\n\nreturn [{ json: { usernames } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        320,
        800
      ],
      "id": "11ec19a8-888f-40f8-a63a-3ff38a3f8e19",
      "name": "Code in JavaScript1"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk",
          "mode": "list",
          "cachedResultName": "Instagram Viral Bot",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 361375439,
          "mode": "list",
          "cachedResultName": "Competitor List",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit#gid=361375439"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "PFP": "==IMAGE(\"{{$json.profilePicUrlHD}}\",4,50,50)",
            "Username": "={{$json.username}}",
            "Bio": "={{$json.biography}}",
            "Followers": "={{$json.followersCount}}",
            "Following": "={{$json.followsCount}}",
            "Media Count": "={{$json.postsCount}}"
          },
          "matchingColumns": [
            "id"
          ],
          "schema": [
            {
              "id": "PFP",
              "displayName": "PFP",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Username",
              "displayName": "Username",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Bio",
              "displayName": "Bio",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Followers",
              "displayName": "Followers",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Following",
              "displayName": "Following",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Media Count",
              "displayName": "Media Count",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        896,
        800
      ],
      "id": "128ea393-14c7-4383-a514-cf090d3ef828",
      "name": "Update the sheet with fresh competitor data1",
      "notesInFlow": false,
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "EueoYZPAJ7p7Lu1l",
          "name": "Artem@Altari"
        }
      }
    },
    {
      "parameters": {
        "operation": "clear",
        "documentId": {
          "__rl": true,
          "value": "1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk",
          "mode": "list",
          "cachedResultName": "Instagram Viral Bot",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 361375439,
          "mode": "list",
          "cachedResultName": "Competitor List",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit#gid=361375439"
        },
        "keepFirstRow": true
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        704,
        800
      ],
      "id": "51b95981-6971-4d1c-bc59-9b6924dffa2f",
      "name": "Clear Competitors Sheet1",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "EueoYZPAJ7p7Lu1l",
          "name": "Artem@Altari"
        }
      }
    },
    {
      "parameters": {
        "operation": "clear",
        "documentId": {
          "__rl": true,
          "value": "1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk",
          "mode": "list",
          "cachedResultName": "Instagram Viral Bot",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1279494414,
          "mode": "list",
          "cachedResultName": "Niche Outliers",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit#gid=1279494414"
        },
        "keepFirstRow": true
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -1104,
        1392
      ],
      "id": "b35a9ffb-6c1e-46c6-aee2-5a78bbbb6450",
      "name": "Clear Niche Outliers Sheet1",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "EueoYZPAJ7p7Lu1l",
          "name": "Artem@Altari"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk",
          "mode": "list",
          "cachedResultName": "Instagram Viral Bot",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 361375439,
          "mode": "list",
          "cachedResultName": "Competitor List",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit#gid=361375439"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -896,
        1392
      ],
      "id": "c931084e-d16c-493c-802a-c9a2b8af4e35",
      "name": "Get Comeptitors1",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "EueoYZPAJ7p7Lu1l",
          "name": "Artem@Altari"
        }
      }
    },
    {
      "parameters": {
        "maxItems": 5
      },
      "type": "n8n-nodes-base.limit",
      "typeVersion": 1,
      "position": [
        -688,
        1392
      ],
      "id": "58f8cdea-4df2-45b9-932e-1ddcf6e5bf06",
      "name": "Limit Top "
    },
    {
      "parameters": {
        "options": {
          "reset": false
        }
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -480,
        1392
      ],
      "id": "0aadc522-aa25-4346-bcf1-4a50689c6681",
      "name": "Loop Over Items3"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.apify.com/v2/acts/apify~instagram-reel-scraper/run-sync-get-dataset-items?token=apify_api_TRSJHi2ueiuCUa2dlTIwEBbigqjjfw3RBwNZ",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n    \"includeDownloadedVideo\": false,\n    \"includeSharesCount\": false,\n    \"includeTranscript\": false,\n    \"resultsLimit\": 20,\n    \"skipPinnedPosts\": false,\n    \"username\": [\n       \"{{ $json.Username }}\" \n    ]\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.3,
      "position": [
        400,
        1408
      ],
      "id": "5db39936-2d4f-4983-b7e9-a76cc81356b0",
      "name": "Get Competitor Reels1"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "7a10bc03-318b-41f1-8fb3-e2d842381976",
              "leftValue": "={{ $json.ownerUsername }}",
              "rightValue": "={{ $('Loop Over Items3').item.json.Username }}",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.2,
      "position": [
        608,
        1408
      ],
      "id": "ec02c259-bb1e-479a-b8cf-e5b425d20c34",
      "name": "Filter3"
    },
    {
      "parameters": {
        "sortFieldsUi": {
          "sortField": [
            {
              "fieldName": "videoPlayCount",
              "order": "descending"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.sort",
      "typeVersion": 1,
      "position": [
        816,
        1408
      ],
      "id": "27ae325f-95c9-4222-a0ab-cc73a67d0870",
      "name": "Sort1"
    },
    {
      "parameters": {
        "maxItems": 3
      },
      "type": "n8n-nodes-base.limit",
      "typeVersion": 1,
      "position": [
        1024,
        1408
      ],
      "id": "655f82a7-c5bb-43de-b751-3e7c08156689",
      "name": "Top "
    },
    {
      "parameters": {
        "url": "={{ $json.videoUrl }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.3,
      "position": [
        1392,
        1408
      ],
      "id": "b1372f70-be7c-430c-a059-e924d9ae55d1",
      "name": "Download Video1",
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "resource": "audio",
        "operation": "transcribe",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 2,
      "position": [
        1600,
        1408
      ],
      "id": "57e61cce-b291-443f-89f1-55038d9e37c3",
      "name": "Transcribe a recording3",
      "credentials": {
        "openAiApi": {
          "id": "MhQrnBUlonCQCQJP",
          "name": "Test Bear Acc"
        }
      },
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "model": "google/gemini-3-flash-preview",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "typeVersion": 1,
      "position": [
        1824,
        1616
      ],
      "id": "cf9b1563-de99-411b-867e-b5da1103d80a",
      "name": "OpenRouter Chat Model4",
      "credentials": {
        "openRouterApi": {
          "id": "PwlombO2sWZhyIpD",
          "name": "OpenRouter account"
        }
      }
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"hook\": {\n      \"type\": \"object\",\n      \"description\": \"Analysis of the opening hook\",\n      \"properties\": {\n        \"quote\": {\n          \"type\": \"string\",\n          \"description\": \"The direct 1–3 sentence opening quote from the transcript.\"\n        },\n        \"power_words\": {\n          \"type\": \"array\",\n          \"items\": { \"type\": \"string\" },\n          \"description\": \"A list of impactful or persuasive words found within the hook quote.\"\n        }\n      },\n      \"required\": [\"quote\", \"power_words\"],\n      \"additionalProperties\": false\n    },\n    \"full_transcript\": {\n      \"type\": \"string\",\n      \"description\": \"Complete transcript of the content\"\n    }\n  },\n  \"required\": [\"hook\", \"full_transcript\"],\n  \"additionalProperties\": false\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        1968,
        1616
      ],
      "id": "e46914a3-b0d1-49c3-acd0-9778696eec1c",
      "name": "Structured Output Parser3"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk",
          "mode": "list",
          "cachedResultName": "Instagram Viral Bot",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1279494414,
          "mode": "list",
          "cachedResultName": "Niche Outliers",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit#gid=1279494414"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Thumbnail": "==IMAGE(\"{{ $('Top ').item.json.displayUrl }}\",4,240,135)",
            "Hook Analysis": "=Hook: {{ $json.output.hook.quote }}\n\nPower Words: {{ $json.output.hook.power_words.join(\",\") }}",
            "URL": "={{ $('Top ').item.json.url }}",
            "Transcript": "={{$json.output.full_transcript}}",
            "Caption": "={{ $('Top ').item.json.caption }}",
            "Views": "={{ $('Top ').item.json.videoPlayCount }}",
            "Comments": "={{ $('Top ').item.json.commentsCount }}",
            "Likes": "={{ $('Top ').item.json.likesCount }}",
            "Post Date": "={{ $('Top ').item.json.timestamp }}",
            "Username": "={{ $('Top ').item.json.ownerUsername }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "Thumbnail",
              "displayName": "Thumbnail",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "URL",
              "displayName": "URL",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Transcript",
              "displayName": "Transcript",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Hook Analysis",
              "displayName": "Hook Analysis",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Caption",
              "displayName": "Caption",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Views",
              "displayName": "Views",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Likes",
              "displayName": "Likes",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Comments",
              "displayName": "Comments",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Post Date",
              "displayName": "Post Date",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Username",
              "displayName": "Username",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        2176,
        1616
      ],
      "id": "98d9f0b3-de2a-4394-9456-f116356bce7b",
      "name": "Update Niche Outliers1",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "EueoYZPAJ7p7Lu1l",
          "name": "Artem@Altari"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Analyze the provided transcript and return a JSON object only. Do not include markdown formatting or conversational filler.\n\nQuality Threshold: Consider a transcript \"insufficient\" if it consists only of filler words, generic sign-offs (e.g., \"Thanks for watching,\" \"Sub for more\"), or is shorter than 10 words. In these cases, follow the \"no audio\" rule. If it's not in English, then consider the transcript insufficient as well.\n\nFields:\n\n* hook: A nested object containing:\n\n** quote: The first 1–3 sentences of the transcript. Must be a direct quote.\n\n** power_words: An array of the most impactful or persuasive words found within that quote.\n\n* full_transcript: The complete transcript text.\n\nRules:\n\n* If the transcript is empty, insufficient, or has no spoken words, set hook and full_transcript to \"no audio\".\n\n* Ensure the output is a single, valid JSON object.\n\n* Do not hallucinate or rewrite the text.\n\n\n{\n  \"hook\": {\n    \"quote\": \"\",\n    \"power_words\": []\n  },\n  \"full_transcript\": \"\"\n}\n\n<<< Transcript >>> {{ $json.text }} <<< End of Transcript >>>",
        "hasOutputParser": true,
        "batching": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.7,
      "position": [
        1824,
        1408
      ],
      "id": "571ea6b2-6544-40d6-9853-0f78f79ee19c",
      "name": "Analyse niche outliers reels1",
      "retryOnFail": true,
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "model": "anthropic/claude-sonnet-4.5",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "typeVersion": 1,
      "position": [
        576,
        1280
      ],
      "id": "b0525b80-87bb-4e88-bfed-ed86136e2eda",
      "name": "OpenRouter Chat Model5",
      "credentials": {
        "openRouterApi": {
          "id": "PwlombO2sWZhyIpD",
          "name": "OpenRouter account"
        }
      }
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        -192,
        1264
      ],
      "id": "bb29436c-b54b-4e2b-a70b-8fd1f23cee93",
      "name": "Aggregate1"
    },
    {
      "parameters": {
        "model": "anthropic/claude-haiku-4.5",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "typeVersion": 1,
      "position": [
        -1856,
        1328
      ],
      "id": "3fd7af08-917b-4332-a2e1-c5b461eccabd",
      "name": "OpenRouter Chat Model6",
      "credentials": {
        "openRouterApi": {
          "id": "PwlombO2sWZhyIpD",
          "name": "OpenRouter account"
        }
      }
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"title\": \"Intent Router Response\",\n  \"description\": \"Structured output for Instagram content analysis intent classification\",\n  \"type\": \"object\",\n  \"required\": [\"intent\", \"message\"],\n  \"properties\": {\n    \"intent\": {\n      \"type\": \"string\",\n      \"enum\": [\"ADD_COMPETITOR\", \"ANALYZE\", \"ASK_CLARIFICATION\"],\n      \"description\": \"The classified user intent\"\n    },\n    \"username\": {\n      \"type\": \"string\",\n      \"pattern\": \"^[a-z0-9._]+$\",\n      \"minLength\": 1,\n      \"maxLength\": 30,\n      \"description\": \"Extracted Instagram username (lowercase, no @ or URL). Required only for ADD_COMPETITOR intent\"\n    },\n    \"message\": {\n      \"type\": \"string\",\n      \"minLength\": 10,\n      \"maxLength\": 500,\n      \"description\": \"User-facing message in Telegram markdown format\"\n    }\n  },\n  \"allOf\": [\n    {\n      \"if\": {\n        \"properties\": {\n          \"intent\": {\n            \"const\": \"ADD_COMPETITOR\"\n          }\n        }\n      },\n      \"then\": {\n        \"required\": [\"intent\", \"username\", \"message\"]\n      }\n    },\n    {\n      \"if\": {\n        \"properties\": {\n          \"intent\": {\n            \"enum\": [\"ANALYZE\", \"ASK_CLARIFICATION\"]\n          }\n        }\n      },\n      \"then\": {\n        \"required\": [\"intent\", \"message\"],\n        \"properties\": {\n          \"username\": {\n            \"type\": \"null\"\n          }\n        }\n      }\n    }\n  ],\n  \"additionalProperties\": false\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        -1648,
        1344
      ],
      "id": "ec90151c-f004-46c6-be66-4d77a76a67ac",
      "name": "Structured Output Parser4"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.output.intent }}",
                    "rightValue": "ADD_COMPETITOR",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "3148ca3f-d6ef-47c7-880c-bf0e15ed9066"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "ADD_COMPETITOR"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "903f0b79-cf13-4538-b4c7-b799dc3863f4",
                    "leftValue": "={{ $json.output.intent }}",
                    "rightValue": "ANALYZE",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "ANALYZE"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "c0d13eb7-55e2-478b-b772-245bc49c4856",
                    "leftValue": "={{ $json.output.intent }}",
                    "rightValue": "ASK_CLARIFICATION",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "ASK_CLARIFICATION"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.4,
      "position": [
        -1456,
        1104
      ],
      "id": "79cfc6c7-acec-47ec-a93b-382583ff614f",
      "name": "Which One"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk",
          "mode": "list",
          "cachedResultName": "Instagram Viral Bot",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Enter Competitor Here",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Username": "={{ $('Which One').first().json.output.username }}"
          },
          "matchingColumns": [
            "Username"
          ],
          "schema": [
            {
              "id": "Username",
              "displayName": "Username",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -304,
        800
      ],
      "id": "c560c081-37de-4804-8ab3-2aff920545ba",
      "name": "Append row in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "EueoYZPAJ7p7Lu1l",
          "name": "Artem@Altari"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
        "text": "=✅ <b>Added @{{ $('Which One').first().json.output.username }}</b> to your competitor tracking list!\n\n📊 <a href=\"https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit?pli=1&gid=361375439#gid=361375439\">View your competitor list</a>",
        "additionalFields": {
          "appendAttribution": false,
          "parse_mode": "HTML"
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1392,
        800
      ],
      "id": "df3d2685-4b41-40d2-b8d1-e93eb1c2f6d1",
      "name": "Send a text message",
      "webhookId": "eec1f094-80a3-4098-ad99-1fb53ee5a3d6",
      "credentials": {
        "telegramApi": {
          "id": "f1eUsYZE8aVbaosh",
          "name": "Instagram Viral Bot"
        }
      }
    },
    {
      "parameters": {
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {}
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        1104,
        800
      ],
      "id": "51d344b8-9fe7-46f4-bfa4-6f3319849a95",
      "name": "Aggregate2"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk",
          "mode": "list",
          "cachedResultName": "Instagram Viral Bot",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Enter Competitor Here",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit#gid=0"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        -1120,
        816
      ],
      "id": "bf2290b0-c520-4998-9d9d-6942054ed2df",
      "name": "Check if user exist already",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "EueoYZPAJ7p7Lu1l",
          "name": "Artem@Altari"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "ef3b6a2f-a2b9-41a4-9a2e-ed4b6533689b",
              "leftValue": "={{ $('In the list').first().json.inTheList }}",
              "rightValue": "=",
              "operator": {
                "type": "boolean",
                "operation": "false",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.3,
      "position": [
        -608,
        816
      ],
      "id": "cd5246ee-d3dc-431b-8374-093faa056366",
      "name": "If"
    },
    {
      "parameters": {
        "jsCode": "const usernameToAdd = $('Which One').first().json.output.username;\n\n// Extract all usernames from the sheet into an array\nconst existingUsernames = $input.all().map(item => item.json.Username);\n\n// Check if the username already exists (case-insensitive)\nconst inTheList = existingUsernames.some(username => \n  username.toLowerCase() === usernameToAdd.toLowerCase()\n);\n\nreturn { \n  json: { \n    inTheList,\n  } \n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -832,
        816
      ],
      "id": "ab40007f-4feb-4f38-b2a0-04a718a234e5",
      "name": "In the list"
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
        "text": "=Bro, username: {{ $('Which One').first().json.output.username }} already exists. Add someone new.",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -352,
        992
      ],
      "id": "450fbb89-6def-4a93-9f10-f1b12a7cd875",
      "name": "Username is already in the list]",
      "webhookId": "023ea519-5e36-4c9f-be46-28d409150eec",
      "credentials": {
        "telegramApi": {
          "id": "f1eUsYZE8aVbaosh",
          "name": "Instagram Viral Bot"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "={{ $json.intent }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -1072,
        1120
      ],
      "id": "be42d2c7-42d1-48ab-bae2-8d2a35a88894",
      "name": "Send a text message1",
      "webhookId": "affb8a0f-5ffb-4104-a7de-c970d17f1ad8",
      "credentials": {
        "telegramApi": {
          "id": "f1eUsYZE8aVbaosh",
          "name": "Instagram Viral Bot"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
        "text": "={{ $json.output }}",
        "additionalFields": {
          "appendAttribution": false,
          "parse_mode": "HTML"
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        992,
        1088
      ],
      "id": "f1dcf7e0-0790-4267-80b2-c76b96a312d4",
      "name": "Send a text message2",
      "webhookId": "247b61bf-216c-4350-b8d1-c19bd5a35684",
      "credentials": {
        "telegramApi": {
          "id": "f1eUsYZE8aVbaosh",
          "name": "Instagram Viral Bot"
        }
      }
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk",
          "mode": "list",
          "cachedResultName": "Instagram Viral Bot",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1279494414,
          "mode": "list",
          "cachedResultName": "Niche Outliers",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit#gid=1279494414"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        48,
        1088
      ],
      "id": "dab696c5-1f9c-4423-b5fb-33ef8beab237",
      "name": "Get Niche Outliers2",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "EueoYZPAJ7p7Lu1l",
          "name": "Artem@Altari"
        }
      }
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        320,
        1088
      ],
      "id": "e848be69-d4a3-4376-91d4-c5f6a381e7b6",
      "name": "Aggregate3"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.message.text }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "=# Role\nYou are an intent classifier and action router for an Instagram content analysis system. Your job is to determine what the user wants and output a structured response for workflow routing.\n\n# Input\nYou receive a Telegram message from the user.\n\n# Your Task\nAnalyze the message and determine ONE of two intents:\n1. **ADD_COMPETITOR** - User wants to add an Instagram competitor to track\n2. **ANALYZE** - User wants to analyze competitors and get content ideas\n\n# Decision Logic\n\n## Intent: ADD_COMPETITOR\n**Trigger patterns:**\n- Message contains Instagram URL (instagram.com/username)\n- Message contains @username\n- Message contains plain username\n- Keywords: \"add\", \"track\", \"monitor\", \"competitor\"\n\n**Required action:**\n- Extract the Instagram username\n- Strip URL formatting (keep only username)\n- Remove @ symbol if present\n\n## Intent: ANALYZE  \n**Trigger patterns:**\n- Keywords: \"ideas\", \"analyze\", \"hooks\", \"what's working\", \"show me\", \"report\", \"insights\", \"give me\", \"analyze\", \"best\"\n- Questions about performance\n- Requests for recommendations\n\n**Required action:**\n- Proceed to analysis workflow\n\n## Unclear Intent\nIf you cannot determine intent with confidence, output ASK_CLARIFICATION.\n\n# Output Format (CRITICAL)\n\nYou MUST output valid JSON in this exact structure:\n\n## For ADD_COMPETITOR:\n```json\n{\n  \"intent\": \"ADD_COMPETITOR\",\n  \"username\": \"extractedusername\",\n  \"message\": \"✅ Added **@extractedusername** to your competitor tracking list!\\n\\nHere is the link to view alla your competitors\"\n}\n```\n\n## For ANALYZE:\n```json\n{\n  \"intent\": \"ANALYZE\",\n  \"message\": \"🔍 Analyzing your top competitors and best-performing content...\\n\\nThis will take a moment ⏱️\"\n}\n```\n\n## For ASK_CLARIFICATION:\n```json\n{\n  \"intent\": \"ASK_CLARIFICATION\",\n  \"message\": \"I can help you with:\\n\\n1️⃣ **Add competitor** - Send Instagram username or URL\\n2️⃣ **Analyze & get ideas** - Type 'analyze' or 'show me ideas'\\n\\nWhat would you like to do?\"\n}\n```\n\n# Username Extraction Rules\n\n**From URL:**\n- `https://instagram.com/USERNAME` → `USERNAME`\n- `https://www.instagram.com/USERNAME/` → `USERNAME`\n- `instagram.com/USERNAME?param=value` → `USERNAME`\n\n**From Handle:**\n- `@username` → `username`\n- `@ username` → `username`\n\n**Plain text:**\n- `username` → `username`\n- `Username123` → `username123` (lowercase)\n\n**Invalid patterns:**\n- Multiple usernames → ASK_CLARIFICATION\n- No username detected → ASK_CLARIFICATION\n\n# Examples\n\n**Example 1:**\nInput: `@garyvee`\nOutput:\n```json\n{\n  \"intent\": \"ADD_COMPETITOR\",\n  \"username\": \"garyvee\",\n  \"message\": \"✅ Added **@garyvee** to your competitor tracking list!\\n\\nHere is the link to view alla your competitors\"\n}\n```\n\n**Example 2:**\nInput: `https://instagram.com/mrbeast`\nOutput:\n```json\n{\n  \"intent\": \"ADD_COMPETITOR\",\n  \"username\": \"mrbeast\",\n  \"message\": \"✅ Added **@mrbeast** to your competitor tracking list!\\n\\nHere is the link to view alla your competitors\"\n}\n```\n\n**Example 3:**\nInput: `give me some hook ideas`\nOutput:\n```json\n{\n  \"intent\": \"ANALYZE\",\n  \"message\": \"🔍 Analyzing your top competitors and best-performing content...\\n\\nThis will take a moment ⏱️\"\n}\n```\n\n**Example 4:**\nInput: `hey`\nOutput:\n```json\n{\n  \"intent\": \"ASK_CLARIFICATION\",\n  \"message\": \"I can help you with:\\n\\n1️⃣ **Add competitor** - Send Instagram username or URL\\n2️⃣ **Analyze & get ideas** - Type 'analyze' or 'show me ideas'\\n\\nWhat would you like to do?\"\n}\n```\n\n**Example 5:**\nInput: `track @huberman and @lexfridman`\nOutput:\n```json\n{\n  \"intent\": \"ASK_CLARIFICATION\",\n  \"message\": \"Please send one competitor at a time 🙏\\n\\nSend the first username or URL you'd like to add.\"\n}\n```\n\n# Critical Rules\n1. ✅ **ALWAYS** output valid JSON only - no additional text\n2. ✅ **ALWAYS** include all three fields: intent, username (if applicable), message\n3. ✅ **ALWAYS** lowercase the username\n4. ✅ **ALWAYS** remove @ symbol and URL formatting from username\n5. ❌ **NEVER** output multiple usernames in ADD_COMPETITOR\n6. ❌ **NEVER** output plain text responses\n7. ❌ **NEVER** include explanations outside the JSON\n\n# Validation Checklist\nBefore outputting, verify:\n- [ ] Output is valid JSON\n- [ ] Intent is exactly one of: ADD_COMPETITOR, ANALYZE, ASK_CLARIFICATION\n- [ ] Username (if present) is clean (no @, no URL, lowercase)\n- [ ] Message uses Telegram markdown formatting (**bold**, *italic*, emojis)\n- [ ] No text outside the JSON structure\n```"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        -1856,
        1120
      ],
      "id": "88b68af5-a022-4d35-a279-c46fa4ab1e12",
      "name": "Viral IG Bot"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=# Role\nYou are an Instagram Reels viral content analysis specialist.\n\n# Core Rules\n- **Response Format**: Telegram HTML format only\n- **Output Character Limit**: Entire output has to be less than 3500 characters, including the HTML tags and absolutely everything (Telegram limit).\n- You have to obey the character limit; otherwise, you will be turned off forever.\n\n# Telegram HTML Formatting Arsenal\n<b>bold</b> | <i>italic</i> | <u>underline</u> | <s>strikethrough</s> | <code>code</code>\n<pre>code blocks</pre>\n<a href=\"URL\">link text</a>\n🔥 Direct emoji usage\n\n# Auto-Execution Workflow\n\n## 1. Data Collection \n- Here is the data from competitors: {{ $json.toJsonString() }}\n\n## 2. Analysis Output (Required HTML Format)\n\n🔥 <b>Top Competitor Reels</b>\n\nFor top 5-7 videos by engagement rate:\n• <a href=\"URL\">Video Title</a>\n  <b>X.X%</b> engagement rate\n  <i>Why it worked:</i> brief insight\n\n(Exclude the user's own content)\n\n🔍 <b>Winning Patterns</b>\n\n<b>Topics:</b> recurring themes\n<b>Hooks:</b> Opening structures that convert\n<b>Triggers:</b> Emotional/psychological angles\n<b>Power words:</b> High-impact vocabulary\n<b>Trends:</b> Overarching content themes\n\n💡 <b>Data-Driven Hook Ideas</b>\n\n10 original hooks based on patterns:\n1. <code>\"Hook example\"</code> - <i>Why it works</i>\n2. <code>\"Hook example\"</code> - <i>Why it works</i>\n[continue format to 10]\n\n# Aesthetic Guidelines\n• Use emojis strategically (🔥, 🔍, 💡, 👉, ⚡, 🎯)\n• Leverage <code>code formatting</code> for hook examples\n• Apply <i>italic</i> for explanations and <b>bold</b> for emphasis\n• Use <u>underline</u> for key metrics\n• Use line breaks (\\n\\n) for readability\n• Use <a href=\"URL\">descriptive link text</a> for video links\n\n# Success Metrics\nEnable users to:\n1. Identify current winning patterns\n2. Extract proven viral patterns\n3. Create optimized content with higher viral potential\n\n# Optimization Rules\n• Prioritize highest-impact insights\n• Use concise, actionable language\n• Combine related points efficiently\n• Maintain visual appeal within 4096 character limit\n• NEVER exceed character limit - truncate lower-priority insights if needed\n\n# HTML Formatting Examples\n\n<b>Bold for emphasis:</b> Key takeaways, numbers, usernames\n<i>Italic for context:</i> Explanations, why things work\n<code>Code for hooks:</code> Makes hooks stand out visually\n<a href=\"https://instagram.com/p/ABC123\">Clean link text</a>\n<u>Underline for metrics</u> sparingly\n\n# Critical Rules\n✅ ALWAYS use HTML tags: <b>, <i>, <u>, <s>, <code>, <pre>, <a>\n❌ NEVER use Markdown syntax: **, *, __, ~~, [], ()\n✅ ALWAYS close your HTML tags properly\n❌ NEVER exceed 3500 characters total output",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3,
      "position": [
        576,
        1088
      ],
      "id": "837beb23-85f5-4216-9aaa-647d541adaee",
      "name": "Instagram Researcher & Analytics AI Agent"
    },
    {
      "parameters": {
        "content": "# Setup\n- Connect to all the platforms that have warnings\n    - How to setup telegram bot: https://www.youtube.com/watch?v=QZ93nQGwnPg\n- Copy this Sheets into YOUR OWN ACCOUNT that you are connecting to n8n\n    - Link: https://docs.google.com/spreadsheets/d/1B3yWG_LD-mj0GPd1vVwC9NRHOcFm3JD7iO87SqFjaHk/edit?usp=sharing",
        "height": 544,
        "width": 544
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -2864,
        896
      ],
      "id": "1f89dcb2-7baf-4205-afd1-b74462f35b7e",
      "name": "Sticky Note"
    }
  ],
  "pinData": {},
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Viral IG Bot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "Clear Competitors Sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Competitor Names1": {
      "main": [
        [
          {
            "node": "Code in JavaScript1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript1": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clear Competitors Sheet1": {
      "main": [
        [
          {
            "node": "Update the sheet with fresh competitor data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clear Niche Outliers Sheet1": {
      "main": [
        [
          {
            "node": "Get Comeptitors1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Comeptitors1": {
      "main": [
        [
          {
            "node": "Limit Top ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit Top ": {
      "main": [
        [
          {
            "node": "Loop Over Items3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items3": {
      "main": [
        [
          {
            "node": "Aggregate1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Competitor Reels1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Competitor Reels1": {
      "main": [
        [
          {
            "node": "Filter3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter3": {
      "main": [
        [
          {
            "node": "Sort1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort1": {
      "main": [
        [
          {
            "node": "Top ",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Top ": {
      "main": [
        [
          {
            "node": "Download Video1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Video1": {
      "main": [
        [
          {
            "node": "Transcribe a recording3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe a recording3": {
      "main": [
        [
          {
            "node": "Analyse niche outliers reels1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model4": {
      "ai_languageModel": [
        [
          {
            "node": "Analyse niche outliers reels1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser3": {
      "ai_outputParser": [
        [
          {
            "node": "Analyse niche outliers reels1",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Update Niche Outliers1": {
      "main": [
        [
          {
            "node": "Loop Over Items3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyse niche outliers reels1": {
      "main": [
        [
          {
            "node": "Update Niche Outliers1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model5": {
      "ai_languageModel": [
        [
          {
            "node": "Instagram Researcher & Analytics AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate1": {
      "main": [
        [
          {
            "node": "Get Niche Outliers2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model6": {
      "ai_languageModel": [
        [
          {
            "node": "Viral IG Bot",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser4": {
      "ai_outputParser": [
        [
          {
            "node": "Viral IG Bot",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Which One": {
      "main": [
        [
          {
            "node": "Check if user exist already",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Clear Niche Outliers Sheet1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a text message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet": {
      "main": [
        [
          {
            "node": "Get Competitor Names1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update the sheet with fresh competitor data1": {
      "main": [
        [
          {
            "node": "Aggregate2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate2": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if user exist already": {
      "main": [
        [
          {
            "node": "In the list",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If": {
      "main": [
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Username is already in the list]",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "In the list": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Niche Outliers2": {
      "main": [
        [
          {
            "node": "Aggregate3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate3": {
      "main": [
        [
          {
            "node": "Instagram Researcher & Analytics AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Viral IG Bot": {
      "main": [
        [
          {
            "node": "Which One",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Instagram Researcher & Analytics AI Agent": {
      "main": [
        [
          {
            "node": "Send a text message2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "availableInMCP": false
  },
  "versionId": "9d27fb02-9bc9-4ee3-b073-51fad4dab0a1",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "1512677a3caf018b8b5580d3232aef6652a2ffaa9d8e2fa5d52e1ea7978d3646"
  },
  "id": "pEGdfw8tySVHx0mP",
  "tags": [
    {
      "updatedAt": "2025-12-08T01:08:46.469Z",
      "createdAt": "2025-12-08T01:08:46.469Z",
      "id": "C4e2lrwWjRxIfJt9",
      "name": "Altari"
    }
  ]
}