Analyze files with Gemini

    Shared 12/3/2025

    11 views

    Visual Workflow

    JSON Code

    {
      "meta": {
        "instanceId": "ca0935fb7d3cc6f244f34460314892df2eee219bc55baa58e8c83ff1b04697f1",
        "templateCredsSetupCompleted": true
      },
      "nodes": [
        {
          "id": "06c626bb-f869-434b-bdd2-64b36117ef61",
          "name": "Analyze video",
          "type": "@n8n/n8n-nodes-langchain.googleGemini",
          "position": [
            2880,
            656
          ],
          "parameters": {
            "text": "**Role:** You are a Senior User Acquisition Analyst for mobile gaming.  \n**Task:** Analyze the provided media (marketing creative). Your goal is to reverse-engineer the offer being presented to the user.\n\n### Extraction Rules:\n- **Game Name:** Identify the exact name of the app or game being advertised. If it is a platform (like Swagbucks/Freecash), name the platform.\n- **Offers:** List the specific actions the user must take. Be precise (e.g., instead of \"play games,\" use \"Reach Level 50\" or \"Complete Chapter 2\").\n- **Payout Structure:** Identify the specific reward. Look for currency symbols ($, £, €) or points.  \n  - Examples: \"$50 for reaching level 10\" or \"10,000 coins for install.\"  \n  - If the payout is tiered (e.g., small amounts for early levels), summarize it as **\"Tiered rewards up to [Total Amount].\"**\n\n### Output Format:\nReturn **ONLY** the JSON object required by the output parser.  \nIf a value is not visible/mentioned, return `\"Not Specified\"`.\n",
            "modelId": {
              "__rl": true,
              "mode": "list",
              "value": "models/gemini-2.5-flash",
              "cachedResultName": "models/gemini-2.5-flash"
            },
            "options": {},
            "resource": "video",
            "simplify": false,
            "operation": "analyze",
            "videoUrls": "={{ $('On form submission').item.json.URL }}"
          },
          "credentials": {
            "googlePalmApi": {
              "id": "Dcm6ikEvNE1dhGxo",
              "name": "Gemini API - Personal"
            }
          },
          "typeVersion": 1
        },
        {
          "id": "be3a5213-306d-43f0-a45b-af04563df5c4",
          "name": "On form submission",
          "type": "n8n-nodes-base.formTrigger",
          "position": [
            640,
            -304
          ],
          "webhookId": "35ca2e8d-ae41-467b-ad1e-d7d0586609a0",
          "parameters": {
            "options": {
              "appendAttribution": false
            },
            "formTitle": "Video Intake",
            "formFields": {
              "values": [
                {
                  "fieldLabel": "URL"
                },
                {
                  "fieldType": "file",
                  "fieldLabel": "Upload file",
                  "multipleFiles": false
                }
              ]
            },
            "formDescription": "Provide a link to the video or image or upload it"
          },
          "typeVersion": 2.3
        },
        {
          "id": "fd8bff7f-0713-4a70-a294-14c9585e5742",
          "name": "AI Agent",
          "type": "@n8n/n8n-nodes-langchain.agent",
          "position": [
            3600,
            672
          ],
          "parameters": {
            "text": "=**Role:** You are a Senior User Acquisition Analyst for mobile gaming.  \n**Task:** Analyze the provided media (marketing creative). Your goal is to reverse-engineer the offer being presented to the user.\n\n### Extraction Rules:\n- **Game Name:** Identify the exact name of the app or game being advertised. If it is a platform (like Swagbucks/Freecash), name the platform.\n- **Offers:** List the specific actions the user must take. Be precise (e.g., instead of \"play games,\" use \"Reach Level 50\" or \"Complete Chapter 2\").\n- **Payout Structure:** Identify the specific reward. Look for currency symbols ($, £, €) or points.  \n  - Examples: \"$50 for reaching level 10\" or \"10,000 coins for install.\"  \n  - If the payout is tiered (e.g., small amounts for early levels), summarize it as **\"Tiered rewards up to [Total Amount].\"**\n\n### Output Format:\nReturn **ONLY** the JSON object required by the output parser.  \nIf a value is not visible/mentioned, return `\"Not Specified\"`.\n\n{{ $binary.data }}",
            "options": {},
            "promptType": "define",
            "needsFallback": true,
            "hasOutputParser": true
          },
          "typeVersion": 3
        },
        {
          "id": "448eefcb-6733-46b2-8f06-64965b11076c",
          "name": "Google Gemini Chat Model",
          "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
          "position": [
            3696,
            896
          ],
          "parameters": {
            "options": {}
          },
          "credentials": {
            "googlePalmApi": {
              "id": "Dcm6ikEvNE1dhGxo",
              "name": "Gemini API - Personal"
            }
          },
          "typeVersion": 1
        },
        {
          "id": "43d87c55-e4c4-47df-8d75-d3615efa024d",
          "name": "OpenAI Chat Model",
          "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
          "position": [
            3600,
            1088
          ],
          "parameters": {
            "model": {
              "__rl": true,
              "mode": "list",
              "value": "gpt-5.1",
              "cachedResultName": "gpt-5.1"
            },
            "options": {},
            "builtInTools": {}
          },
          "credentials": {
            "openAiApi": {
              "id": "tjf9ytf3xLEqDCRr",
              "name": "OpenAi account"
            }
          },
          "typeVersion": 1.3
        },
        {
          "id": "fd921ca2-7e61-4337-8c13-9a1d04a64c54",
          "name": "Structured Output Parser",
          "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
          "position": [
            3792,
            1088
          ],
          "parameters": {
            "schemaType": "manual",
            "inputSchema": "{\n  \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n  \"title\": \"OfferExtractionSchema\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"game\": {\n      \"type\": \"string\",\n      \"description\": \"Exact name of the game/app/platform being advertised. Use 'Not Specified' if unavailable.\"\n    },\n    \"offers\": {\n      \"type\": \"array\",\n      \"description\": \"List of specific actions the user must take.\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"payout_structure\": {\n      \"type\": \"string\",\n      \"description\": \"Clear payout or reward structure. Use 'Not Specified' if unavailable.\"\n    }\n  },\n  \"required\": [\"game\", \"offers\", \"payout_structure\"],\n  \"additionalProperties\": false\n}\n"
          },
          "typeVersion": 1.3
        },
        {
          "id": "a103bb6e-422c-4b7b-95e6-8bbefcec574a",
          "name": "Get iOS App",
          "type": "n8n-nodes-base.httpRequest",
          "position": [
            3200,
            -16
          ],
          "parameters": {
            "url": "=https://apps.apple.com/us/iphone/search?term={{ $('Code in JavaScript').item.json.gameName }}",
            "options": {}
          },
          "typeVersion": 4.3
        },
        {
          "id": "ea1c3438-9d6b-43e6-bad0-7beadac58d65",
          "name": "Get Android App",
          "type": "n8n-nodes-base.httpRequest",
          "position": [
            3216,
            -512
          ],
          "parameters": {
            "url": "=https://play.google.com/store/search?q={{ $('Code in JavaScript').item.json.gameName }}&c=apps",
            "options": {}
          },
          "typeVersion": 4.3
        },
        {
          "id": "66c70762-35f9-4a09-9344-782d3c0ee02e",
          "name": "Append row in sheet",
          "type": "n8n-nodes-base.googleSheets",
          "position": [
            2752,
            -288
          ],
          "parameters": {
            "columns": {
              "value": {
                "Game": "={{ $json.gameName }}",
                "Offers": "={{ $json.offers }}",
                "Payout Structure": "={{ $json.payoutStructure }}"
              },
              "schema": [
                {
                  "id": "Game",
                  "type": "string",
                  "display": true,
                  "removed": false,
                  "required": false,
                  "displayName": "Game",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "Offers",
                  "type": "string",
                  "display": true,
                  "removed": false,
                  "required": false,
                  "displayName": "Offers",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "Payout Structure",
                  "type": "string",
                  "display": true,
                  "removed": false,
                  "required": false,
                  "displayName": "Payout Structure",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "App Store ID (iOS)",
                  "type": "string",
                  "display": true,
                  "removed": false,
                  "required": false,
                  "displayName": "App Store ID (iOS)",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "PlayStore ID (Android)",
                  "type": "string",
                  "display": true,
                  "removed": false,
                  "required": false,
                  "displayName": "PlayStore ID (Android)",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                }
              ],
              "mappingMode": "defineBelow",
              "matchingColumns": [],
              "attemptToConvertTypes": false,
              "convertFieldsToString": false
            },
            "options": {},
            "operation": "append",
            "sheetName": {
              "__rl": true,
              "mode": "list",
              "value": "gid=0",
              "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oseH0iifhwegtlBU00PIzi9SF9MSbeop4V4hcxqVCfs/edit#gid=0",
              "cachedResultName": "GAMES/OFFERS"
            },
            "documentId": {
              "__rl": true,
              "mode": "list",
              "value": "1oseH0iifhwegtlBU00PIzi9SF9MSbeop4V4hcxqVCfs",
              "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oseH0iifhwegtlBU00PIzi9SF9MSbeop4V4hcxqVCfs/edit?usp=drivesdk",
              "cachedResultName": "Competitor Analysis"
            }
          },
          "credentials": {
            "googleSheetsOAuth2Api": {
              "id": "n434ebqBlO2QBh7B",
              "name": "Google Sheets account"
            }
          },
          "typeVersion": 4.7
        },
        {
          "id": "64d128c2-7341-46b3-9213-55dfbbb7557f",
          "name": "HTML",
          "type": "n8n-nodes-base.html",
          "position": [
            3472,
            -16
          ],
          "parameters": {
            "options": {},
            "operation": "extractHtmlContent",
            "extractionValues": {
              "values": [
                {
                  "key": "links",
                  "cssSelector": "a",
                  "returnArray": true,
                  "returnValue": "attribute"
                }
              ]
            }
          },
          "typeVersion": 1.2
        },
        {
          "id": "3affa9e7-2e9d-4840-b1ad-408a4f11d1dd",
          "name": "Split Out",
          "type": "n8n-nodes-base.splitOut",
          "position": [
            4112,
            688
          ],
          "parameters": {
            "include": "allOtherFields",
            "options": {},
            "fieldToSplitOut": "links"
          },
          "typeVersion": 1
        },
        {
          "id": "b69432d8-835b-4b2e-8444-2e3017670bd1",
          "name": "If1",
          "type": "n8n-nodes-base.if",
          "position": [
            4448,
            688
          ],
          "parameters": {
            "options": {},
            "conditions": {
              "options": {
                "version": 2,
                "leftValue": "",
                "caseSensitive": true,
                "typeValidation": "strict"
              },
              "combinator": "and",
              "conditions": [
                {
                  "id": "04aabf3b-3181-4c73-932a-87f1083fc49c",
                  "operator": {
                    "type": "boolean",
                    "operation": "true",
                    "singleValue": true
                  },
                  "leftValue": "={{ $json.links.href.includes(\"id\") }}",
                  "rightValue": ""
                }
              ]
            }
          },
          "typeVersion": 2.2
        },
        {
          "id": "ec85ebcb-162c-4292-ac7e-2e0f84feb9f7",
          "name": "Aggregate",
          "type": "n8n-nodes-base.aggregate",
          "position": [
            4768,
            672
          ],
          "parameters": {
            "options": {},
            "aggregate": "aggregateAllItemData"
          },
          "typeVersion": 1
        },
        {
          "id": "3c61ef04-4279-41dc-9dba-d172ac499e1c",
          "name": "Code in Python (Native) (Beta)",
          "type": "n8n-nodes-base.code",
          "position": [
            3728,
            -16
          ],
          "parameters": {
            "language": "pythonNative",
            "pythonCode": "links = _items[0][\"json\"][\"links\"]\n\ncleaned = []\nfor link in links:\n    href = link.get(\"href\", \"\")\n    test_id = link.get(\"data-test-id\", \"\")\n    app_id = \"/id\"\n    # Skip links containing \"search\"\n    if \"search\" in href:\n        continue\n    # Skip links with data-test-id containing \"other-language\"\n    if \"other-language\" in test_id:\n        continue\n    if app_id not in href:\n        continue\n    cleaned.append(link)\n\noutput = cleaned\n\nreturn output"
          },
          "typeVersion": 2
        },
        {
          "id": "c57ecb60-d796-4f10-9158-a2beb0054a27",
          "name": "Aggregate1",
          "type": "n8n-nodes-base.aggregate",
          "position": [
            4016,
            -16
          ],
          "parameters": {
            "options": {},
            "aggregate": "aggregateAllItemData",
            "destinationFieldName": "links"
          },
          "typeVersion": 1
        },
        {
          "id": "aa8aba4b-7368-4c27-b983-cfde72ebfecc",
          "name": "HTML1",
          "type": "n8n-nodes-base.html",
          "position": [
            3488,
            -512
          ],
          "parameters": {
            "options": {},
            "operation": "extractHtmlContent",
            "extractionValues": {
              "values": [
                {
                  "key": "links",
                  "cssSelector": "a",
                  "returnArray": true,
                  "returnValue": "attribute"
                }
              ]
            }
          },
          "typeVersion": 1.2
        },
        {
          "id": "1a01b299-dda7-4097-8204-7f2544b42deb",
          "name": "Code in Python (Native) (Beta)1",
          "type": "n8n-nodes-base.code",
          "position": [
            3744,
            -512
          ],
          "parameters": {
            "language": "pythonNative",
            "pythonCode": "links = _items[0][\"json\"][\"links\"]\n\ncleaned = []\nfor link in links:\n    href = link.get(\"href\", \"\")\n    test_id = link.get(\"data-test-id\", \"\")\n    app_id = \"?id\"\n    # Skip links containing \"search\"\n    if \"search\" in href:\n        continue\n    if app_id not in href:\n        continue\n    sanitized = {k: v for k, v in link.items() if k != \"jslog\"}\n\n    cleaned.append(sanitized)\n\noutput = cleaned\n\nreturn output"
          },
          "typeVersion": 2
        },
        {
          "id": "21b43cc3-13d6-4fff-a29f-db0f01eb7ea7",
          "name": "Aggregate2",
          "type": "n8n-nodes-base.aggregate",
          "position": [
            4016,
            -512
          ],
          "parameters": {
            "options": {},
            "aggregate": "aggregateAllItemData",
            "destinationFieldName": "links"
          },
          "typeVersion": 1
        },
        {
          "id": "c49564ac-80da-4888-a0c1-7f85b12dc7c2",
          "name": "AI Agent1",
          "type": "@n8n/n8n-nodes-langchain.agent",
          "position": [
            4256,
            -512
          ],
          "parameters": {
            "text": "=\n# TASK\nFind the most appropriate ID based on the following game name and the provided list of IDs. The ID will be the query parameter whose key is 'id'. \n\nFor example, if the game name is \"Dice Dreams\" and the list of hrefs is: [{\"href\":\"/store/apps/details?id=com.superplaystudios.dicedreams\",\"class\":\"Qfxief\"},{\"class\":\"Si6A0c Gy4nib\",\"href\":\"/store/apps/details?id=com.screenshake.dominodreams\"}]. Then the relevant href is \"/store/apps/details?id=com.superplaystudios.dicedreams\", and the id for the game Dice Dreams is com.superplaystudios.dicedreams from the URL. Therefore the value to return is com.superplaystudios.dicedreams.\n\n## GAME NAME\n{{ $('Code in JavaScript').item.json.gameName }}\n\n## LIST OF LINKS\n{{ $json.links.toJsonString() }}",
            "options": {},
            "promptType": "define",
            "hasOutputParser": true
          },
          "typeVersion": 3
        },
        {
          "id": "6b01a784-3d02-4c7a-afd9-ae9be6327310",
          "name": "AI Agent2",
          "type": "@n8n/n8n-nodes-langchain.agent",
          "position": [
            4256,
            -16
          ],
          "parameters": {
            "text": "=\n# TASK\nFind the most appropriate ID based on the following game name and the provided list of IDs. The ID will be the last slug of the URL that starts with 'id'\n\nFor example, if the game name is \"Dice Dreams\" and the list of hrefs is: \n[{\"aria-label\":\"View Dice Dreams™\",\"href\":\"https://apps.apple.com/us/app/dice-dreams/id1484468651\",\"data-test-id\":\"internal-link\"},{\"aria-label\":\"View Dice Dreams™\",\"href\":\"https://apps.apple.com/us/app/domino-dreams/id6444043291\",\"data-test-id\":\"internal-link\"},{\"aria-label\":\"View Coin Master\",\"href\":\"https://apps.apple.com/us/app/coin-master/id406889139\",\"data-test-id\":\"internal-link\"},{\"aria-label\":\"View Board Kings-Board Dice Games\",\"href\":\"https://apps.apple.com/us/app/board-kings-board-dice-games/id1116488672\",\"data-test-id\":\"internal-link\"}]\n\nThen the relevant href is \"https://apps.apple.com/us/app/dice-dreams/id1484468651\", and the id for the game Dice Dreams is id1484468651 from the URL. Therefore the value to return is id1484468651.\n\n## GAME NAME\n{{ $('Code in JavaScript').item.json.gameName }}\n\n## LIST OF LINKS\n{{ $json.links.toJsonString() }}",
            "options": {},
            "promptType": "define",
            "hasOutputParser": true
          },
          "typeVersion": 3
        },
        {
          "id": "58d8af14-0a32-4ddc-a33a-d7d319d89a4f",
          "name": "Merge",
          "type": "n8n-nodes-base.merge",
          "position": [
            4912,
            -304
          ],
          "parameters": {},
          "typeVersion": 3.2,
          "alwaysOutputData": true
        },
        {
          "id": "d18aaa23-76da-4f7e-873c-c85e8041d00c",
          "name": "Get row(s) in sheet",
          "type": "n8n-nodes-base.googleSheets",
          "position": [
            4624,
            -512
          ],
          "parameters": {
            "options": {},
            "filtersUI": {
              "values": [
                {
                  "lookupValue": "={{ $json.output.gameID }}",
                  "lookupColumn": "PlayStore ID (Android)"
                }
              ]
            },
            "sheetName": {
              "__rl": true,
              "mode": "list",
              "value": "gid=0",
              "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oseH0iifhwegtlBU00PIzi9SF9MSbeop4V4hcxqVCfs/edit#gid=0",
              "cachedResultName": "GAMES/OFFERS"
            },
            "documentId": {
              "__rl": true,
              "mode": "list",
              "value": "1oseH0iifhwegtlBU00PIzi9SF9MSbeop4V4hcxqVCfs",
              "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oseH0iifhwegtlBU00PIzi9SF9MSbeop4V4hcxqVCfs/edit?usp=drivesdk",
              "cachedResultName": "Competitor Analysis"
            }
          },
          "credentials": {
            "googleSheetsOAuth2Api": {
              "id": "n434ebqBlO2QBh7B",
              "name": "Google Sheets account"
            }
          },
          "typeVersion": 4.7,
          "alwaysOutputData": true
        },
        {
          "id": "8700701a-9406-428a-aa00-886b1749d613",
          "name": "Get row(s) in sheet1",
          "type": "n8n-nodes-base.googleSheets",
          "position": [
            4624,
            -16
          ],
          "parameters": {
            "options": {},
            "filtersUI": {
              "values": [
                {
                  "lookupValue": "={{ $json.output.gameID }}",
                  "lookupColumn": "App Store ID (iOS)"
                }
              ]
            },
            "sheetName": {
              "__rl": true,
              "mode": "list",
              "value": "gid=0",
              "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oseH0iifhwegtlBU00PIzi9SF9MSbeop4V4hcxqVCfs/edit#gid=0",
              "cachedResultName": "GAMES/OFFERS"
            },
            "documentId": {
              "__rl": true,
              "mode": "list",
              "value": "1oseH0iifhwegtlBU00PIzi9SF9MSbeop4V4hcxqVCfs",
              "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oseH0iifhwegtlBU00PIzi9SF9MSbeop4V4hcxqVCfs/edit?usp=drivesdk",
              "cachedResultName": "Competitor Analysis"
            }
          },
          "credentials": {
            "googleSheetsOAuth2Api": {
              "id": "n434ebqBlO2QBh7B",
              "name": "Google Sheets account"
            }
          },
          "typeVersion": 4.7,
          "alwaysOutputData": true
        },
        {
          "id": "967269b0-322b-489f-9b0e-c0b31cf6c6b6",
          "name": "If2",
          "type": "n8n-nodes-base.if",
          "position": [
            4368,
            992
          ],
          "parameters": {
            "options": {},
            "conditions": {
              "options": {
                "version": 2,
                "leftValue": "",
                "caseSensitive": true,
                "typeValidation": "strict"
              },
              "combinator": "and",
              "conditions": [
                {
                  "id": "91bcfda2-5dcc-4b51-8afd-f78de46e91dd",
                  "operator": {
                    "type": "object",
                    "operation": "empty",
                    "singleValue": true
                  },
                  "leftValue": "={{ $json }}",
                  "rightValue": ""
                }
              ]
            }
          },
          "typeVersion": 2.2
        },
        {
          "id": "31f5a342-04e4-4c61-bf99-8b53f65416a0",
          "name": "Send a message",
          "type": "n8n-nodes-base.gmail",
          "position": [
            5856,
            -352
          ],
          "webhookId": "b9fbe4c8-e217-4f2a-8bcb-b3997ee5584e",
          "parameters": {
            "sendTo": "njogued@gmail.com",
            "message": "=New Game Added to the Spreadsheet.\n\nGame Details:\nName: {{ $('Code in JavaScript').item.json.gameName }}\n\nOffers: {{ $('Code in JavaScript').item.json.offers }}\n\nPayout Structure: {{ $('Code in JavaScript').item.json.payoutStructure }}\n",
            "options": {},
            "subject": "NEW GAME ALERT!"
          },
          "credentials": {
            "gmailOAuth2": {
              "id": "c3iKg7fkmFbTwlnB",
              "name": "Gmail account"
            }
          },
          "executeOnce": true,
          "typeVersion": 2.1
        },
        {
          "id": "81c69f6d-30ef-47e0-806f-c46af75fda6e",
          "name": "AI Agent3",
          "type": "@n8n/n8n-nodes-langchain.agent",
          "position": [
            3168,
            560
          ],
          "parameters": {
            "text": "**Role:** You are a Senior User Acquisition Analyst for mobile gaming.  \n**Task:** Analyze the provided media (marketing creative). Your goal is to reverse-engineer the offer being presented to the user.\n\n### Extraction Rules:\n- **Game Name:** Return **only the exact name of the game/app**, with **no extra wording, descriptions, or context**.  \n  - Example: If the media says \"The main highlighted game is Dice Dreams and you can earn…\", the correct output is **\"Dice Dreams\"** only.\n  - If it is a platform (e.g., Swagbucks, Freecash), return the platform name only.\n- **Offers:** List the specific actions the user must take. Be precise (e.g., “Reach Level 50,” “Complete Chapter 2”).\n- **Payout Structure:** Identify the specific reward. Look for $, £, €, or points.  \n  - Examples: \"$50 for reaching level 10\", \"10,000 coins for install\".  \n  - If tiered: return **\"Tiered rewards up to [Total Amount]\"**.\n\n### Output Format:\nReturn **ONLY** the JSON object required by the output parser.  \nIf a value is not visible/mentioned, return `\"Not Specified\"`.\n\n# INPUT VIDEO URL\n",
            "options": {},
            "promptType": "define",
            "hasOutputParser": true
          },
          "typeVersion": 3
        },
        {
          "id": "cfb71f75-808f-4320-90fd-0dafdf73d39f",
          "name": "Google Gemini Chat Model1",
          "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
          "position": [
            3168,
            768
          ],
          "parameters": {
            "options": {}
          },
          "credentials": {
            "googlePalmApi": {
              "id": "Dcm6ikEvNE1dhGxo",
              "name": "Gemini API - Personal"
            }
          },
          "typeVersion": 1
        },
        {
          "id": "3044b0c0-0dc6-4856-a90a-5ecab6154a22",
          "name": "Google Gemini Chat Model2",
          "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
          "position": [
            4240,
            -304
          ],
          "parameters": {
            "options": {}
          },
          "credentials": {
            "googlePalmApi": {
              "id": "Dcm6ikEvNE1dhGxo",
              "name": "Gemini API - Personal"
            }
          },
          "typeVersion": 1
        },
        {
          "id": "c2179ecb-8375-48cb-b8f4-0ba227b21b26",
          "name": "Google Gemini Chat Model3",
          "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
          "position": [
            4208,
            208
          ],
          "parameters": {
            "options": {}
          },
          "credentials": {
            "googlePalmApi": {
              "id": "Dcm6ikEvNE1dhGxo",
              "name": "Gemini API - Personal"
            }
          },
          "typeVersion": 1
        },
        {
          "id": "88e3031e-4f0e-491f-b62a-bd72c153a34e",
          "name": "Structured Output Parser2",
          "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
          "position": [
            4432,
            -304
          ],
          "parameters": {
            "autoFix": true,
            "schemaType": "manual",
            "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"gameID\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
          },
          "typeVersion": 1.3
        },
        {
          "id": "a48c9346-82db-48e8-b41f-ad0107310252",
          "name": "Structured Output Parser3",
          "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
          "position": [
            4400,
            160
          ],
          "parameters": {
            "autoFix": true,
            "schemaType": "manual",
            "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"gameID\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
          },
          "typeVersion": 1.3
        },
        {
          "id": "73a8cac8-26f2-4674-b40c-177581cc4425",
          "name": "Wait",
          "type": "n8n-nodes-base.wait",
          "position": [
            1808,
            800
          ],
          "webhookId": "7d0cd0c0-ce85-4372-b7a5-b0be061fc2b9",
          "parameters": {},
          "typeVersion": 1.1
        },
        {
          "id": "c00dcac2-658d-4710-b63b-09c93093404b",
          "name": "Download video",
          "type": "n8n-nodes-base.httpRequest",
          "position": [
            2896,
            960
          ],
          "parameters": {
            "url": "={{ $('On form submission').item.json.URL }}",
            "options": {}
          },
          "typeVersion": 4.2
        },
        {
          "id": "d0475da6-b47e-48cc-91ff-f4f8bc7d738e",
          "name": "Upload video Gemini",
          "type": "n8n-nodes-base.httpRequest",
          "position": [
            1584,
            800
          ],
          "parameters": {
            "url": "=https://generativelanguage.googleapis.com/upload/v1beta/files?key={{ $vars.GeminiKey }}",
            "method": "POST",
            "options": {},
            "sendBody": true,
            "contentType": "binaryData",
            "sendHeaders": true,
            "headerParameters": {
              "parameters": [
                {
                  "name": "X-Goog-Upload-Command",
                  "value": "start, upload, finalize"
                },
                {
                  "name": "X-Goog-Upload-Header-Content-Length",
                  "value": "={{ $binary.data.fileSize }}"
                },
                {
                  "name": "X-Goog-Upload-Header-Content-Type",
                  "value": "=video/{{ $binary.data.fileExtension }}"
                },
                {
                  "name": "Content-Type",
                  "value": "video/mp4"
                }
              ]
            },
            "inputDataFieldName": "=data"
          },
          "typeVersion": 4.2
        },
        {
          "id": "bfdfd2c1-7c62-4805-8a7c-9fd8a4adf18f",
          "name": "Analyze video Gemini",
          "type": "n8n-nodes-base.httpRequest",
          "position": [
            2032,
            800
          ],
          "parameters": {
            "url": "=https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-exp:generateContent?key={{ $vars.GeminiKey }}",
            "method": "POST",
            "options": {},
            "jsonBody": "={\n    \"contents\": [\n        {\n            \"role\": \"user\",\n            \"parts\": [\n                {\n                    \"fileData\": {\n                        \"fileUri\": \"{{ $json.file.uri }}\",\n                        \"mimeType\": \"{{ $json.file.mimeType }}\"\n                    }\n                },\n                {\n                    \"text\": \"Describe in detail what is visually happening in the video, including key elements, actions, colors, and branding. Note the style, tone, and any notable creative techniques being used.\"\n                }\n            ]\n        }\n    ],\n    \"generationConfig\": {\n        \"temperature\": 1.4,\n        \"topK\": 40,\n        \"topP\": 0.95,\n        \"maxOutputTokens\": 8192,\n        \"responseModalities\": [\"Text\"]\n    }\n}\n",
            "sendBody": true,
            "sendHeaders": true,
            "specifyBody": "json",
            "headerParameters": {
              "parameters": [
                {
                  "name": "Content-Type",
                  "value": "application/json"
                }
              ]
            }
          },
          "typeVersion": 4.2
        },
        {
          "id": "1e8d38c3-b174-4c9a-8bf0-8ef6d0c9370b",
          "name": "Get Result",
          "type": "n8n-nodes-base.set",
          "position": [
            2240,
            800
          ],
          "parameters": {
            "options": {},
            "assignments": {
              "assignments": [
                {
                  "id": "1ea390b9-3371-4a3a-8741-bd6ec74dc64b",
                  "name": "videoDescription",
                  "type": "string",
                  "value": "={{ $json.candidates[0].content.parts[0].text }}"
                }
              ]
            }
          },
          "typeVersion": 3.4
        },
        {
          "id": "bbc5973d-c93f-488b-a637-a3ee3287506f",
          "name": "Sticky Note3",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            1920,
            -1104
          ],
          "parameters": {
            "color": 4,
            "width": 2080,
            "height": 344,
            "content": "## Video Analysis with Gemini AI\n\nThis workflow demonstrates how to analyze video content using Google's Gemini API:\n1. Capture user uploaded media or URL\n2. Upload media to Gemini's servers\n3. Process the media with AI to generate a description with structured output\n4. Extract the analysis results\n\nOUTPUT: The workflow produces a description of the video content including the game name, offers, and the payout structue. \n\n⚙️ **Before using this workflow**, make sure to set the `GeminiKey` Query Auth with your Gemini API key.  \nThis ensures your API key is securely managed and not hardcoded in the workflow."
          },
          "typeVersion": 1
        },
        {
          "id": "4e7e0a4d-2a11-4e01-b438-2a1fc0b2797a",
          "name": "Sticky Note1",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            864,
            -720
          ],
          "parameters": {
            "color": 4,
            "width": 1508,
            "height": 1132,
            "content": "## Media Processing Pipeline\n\nThis section handles the complete media processing workflow:\n\n1. UPLOAD: We send the binary image/video data to Gemini's servers where it's stored temporarily for AI processing\n\n2. ANALYZE: We request Gemini's AI to analyze the content. You can customize the prompt in the \"Analyze\" node to focus on specific aspects of the video content you're interested in\n"
          },
          "typeVersion": 1
        },
        {
          "id": "aa2d350e-7a61-4d10-95b7-a9d65bf22e2d",
          "name": "If3",
          "type": "n8n-nodes-base.if",
          "position": [
            2560,
            816
          ],
          "parameters": {
            "options": {},
            "conditions": {
              "options": {
                "version": 2,
                "leftValue": "",
                "caseSensitive": true,
                "typeValidation": "strict"
              },
              "combinator": "or",
              "conditions": [
                {
                  "id": "0b881ee8-5080-4ea6-9dce-8c4645a59ac4",
                  "operator": {
                    "type": "string",
                    "operation": "contains"
                  },
                  "leftValue": "={{ $json.URL }}",
                  "rightValue": "youtube.com"
                },
                {
                  "id": "21bde914-fe17-4969-b29e-f30c53ecad73",
                  "operator": {
                    "type": "string",
                    "operation": "contains"
                  },
                  "leftValue": "={{ $json.URL }}",
                  "rightValue": "youtu.be"
                }
              ]
            }
          },
          "typeVersion": 2.2
        },
        {
          "id": "dfe266e9-1765-4613-8806-eac6528d84c7",
          "name": "Structured Output Parser4",
          "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
          "position": [
            3312,
            768
          ],
          "parameters": {
            "schemaType": "manual",
            "inputSchema": "{\n  \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n  \"title\": \"OfferExtractionSchema\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"game\": {\n      \"type\": \"string\",\n      \"description\": \"Exact name of the game/app/platform being advertised. Use 'Not Specified' if unavailable.\"\n    },\n    \"offers\": {\n      \"type\": \"array\",\n      \"description\": \"List of specific actions the user must take.\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"payout_structure\": {\n      \"type\": \"string\",\n      \"description\": \"Clear payout or reward structure. Use 'Not Specified' if unavailable.\"\n    }\n  },\n  \"required\": [\"game\", \"offers\", \"payout_structure\"],\n  \"additionalProperties\": false\n}\n"
          },
          "typeVersion": 1.3
        },
        {
          "id": "8d0bc57b-733d-4ad8-9bfe-33044b0066d7",
          "name": "Initiated Gemini Upload",
          "type": "n8n-nodes-base.httpRequest",
          "position": [
            3296,
            960
          ],
          "parameters": {
            "url": "https://generativelanguage.googleapis.com/upload/v1beta/files",
            "method": "POST",
            "options": {
              "response": {
                "response": {
                  "fullResponse": true
                }
              }
            },
            "jsonBody": "{\n  \"file\":{\n    \"display_name\":\"filename\"\n  }\n}",
            "sendBody": true,
            "sendHeaders": true,
            "specifyBody": "json",
            "authentication": "genericCredentialType",
            "genericAuthType": "httpHeaderAuth",
            "headerParameters": {
              "parameters": [
                {
                  "name": "Content-Type",
                  "value": "application/json"
                },
                {
                  "name": "X-Goog-Upload-Protocol",
                  "value": "resumable"
                },
                {
                  "name": "X-Goog-Upload-Command",
                  "value": "start"
                },
                {
                  "name": "X-Goog-Upload-Header-Content-Type",
                  "value": "124"
                },
                {
                  "name": "X-Goog-Upload-Header-Content-Length",
                  "value": "234"
                }
              ]
            }
          },
          "credentials": {
            "httpHeaderAuth": {
              "id": "YbYFlplSWxlmVqtk",
              "name": "Header Auth account"
            }
          },
          "typeVersion": 4.3
        },
        {
          "id": "5a71300c-6ee2-43b4-ba92-6e0919fc0f76",
          "name": "initiateUpload",
          "type": "n8n-nodes-base.httpRequest",
          "position": [
            1968,
            1200
          ],
          "parameters": {
            "url": "https://generativelanguage.googleapis.com/upload/v1beta/files",
            "method": "POST",
            "options": {
              "response": {
                "response": {
                  "fullResponse": true
                }
              }
            },
            "jsonBody": "={\n  \"file\":{\n    \"display_name\":\" {{ $binary.data.fileName }}\"\n  }\n}",
            "sendBody": true,
            "sendHeaders": true,
            "specifyBody": "json",
            "authentication": "genericCredentialType",
            "genericAuthType": "httpQueryAuth",
            "headerParameters": {
              "parameters": [
                {
                  "name": "X-Goog-Upload-Protocol",
                  "value": "resumable"
                },
                {
                  "name": "X-Goog-Upload-Command",
                  "value": "start"
                },
                {
                  "name": "X-Goog-Upload-Header-Content-Length",
                  "value": "={{ $binary.data.fileSize.split(\" \")[0]*1000 }}"
                },
                {
                  "name": "X-Goog-Upload-Header-Content-Type",
                  "value": "={{ $binary.data.mimeType }}"
                },
                {
                  "name": "Content-Type",
                  "value": "application/json"
                }
              ]
            }
          },
          "credentials": {
            "httpQueryAuth": {
              "id": "CZHUfV9qSxpvy0iG",
              "name": "Gemini Query Auth - Storied"
            }
          },
          "typeVersion": 4.2
        },
        {
          "id": "5302b67d-18e6-4bea-a394-de192f3e6f40",
          "name": "Upload",
          "type": "n8n-nodes-base.httpRequest",
          "position": [
            2704,
            1200
          ],
          "parameters": {
            "url": "={{ $('initiateUpload').item.json.headers['x-goog-upload-url'] }}",
            "method": "POST",
            "options": {},
            "sendBody": true,
            "contentType": "binaryData",
            "sendHeaders": true,
            "authentication": "genericCredentialType",
            "genericAuthType": "httpQueryAuth",
            "headerParameters": {
              "parameters": [
                {
                  "name": "Content-Length",
                  "value": "={{ $binary.data.fileSize.split(\" \")[0]*1000 }}"
                },
                {
                  "name": "X-Goog-Upload-Offset",
                  "value": "0"
                },
                {
                  "name": "X-Goog-Upload-Command",
                  "value": "upload, finalize"
                }
              ]
            },
            "inputDataFieldName": "=data"
          },
          "credentials": {
            "httpQueryAuth": {
              "id": "6Yqr0HmtxtByNFXX",
              "name": "Gemini Query Auth Personal"
            }
          },
          "typeVersion": 4.2
        },
        {
          "id": "5bf5166f-eb53-4303-8608-a71bfaa641b0",
          "name": "Code",
          "type": "n8n-nodes-base.code",
          "position": [
            2368,
            1200
          ],
          "parameters": {
            "jsCode": "return{\n  json: {},\n  binary: $('Download Image').item.binary\n}"
          },
          "typeVersion": 2
        },
        {
          "id": "0905ed99-918c-4cfd-b7ad-3412cfc76eb1",
          "name": "Analyze",
          "type": "n8n-nodes-base.httpRequest",
          "position": [
            2016,
            -288
          ],
          "parameters": {
            "url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-exp:generateContent",
            "method": "POST",
            "options": {
              "response": {
                "response": {
                  "fullResponse": true
                }
              }
            },
            "jsonBody": "={\n  \"contents\": [\n    {\n      \"role\": \"user\",\n      \"parts\": [\n        {\n          \"fileData\": {\n            \"mimeType\": \"{{ $json.mimeType }}\",\n            \"fileUri\": \"{{ $json.fileUri }}\"\n          }\n        },\n        {\n          \"text\": \"Role: You are a Senior User Acquisition Analyst for mobile gaming.\\nTask: Analyze the provided media (marketing creative) and reverse-engineer the offer being presented to the user.\\nExtraction Rules:\\n- Game Name: Identify the exact name of the app or game being advertised; if it is a platform, name the platform.\\n- Offers: List the specific actions the user must take with precise language (e.g., \\\"Reach Level 50\\\", \\\"Complete Chapter 2\\\").\\n- Payout Structure: Identify the reward, including currency or points (e.g., \\\"$50 for reaching level 10\\\"); if tiered, summarize as \\\"Tiered rewards up to [Total Amount]\\\".\\nOutput Format: Return ONLY the JSON object required by the output parser, and use \\\"Not Specified\\\" for missing values.\"\n        }\n      ]\n    }\n  ],\n  \"generationConfig\": {\n    \"responseMimeType\": \"application/json\",\n    \"responseJsonSchema\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"gameName\": {\n          \"type\": \"string\"\n        },\n        \"offers\": {\n          \"type\": \"string\"\n        },\n        \"payoutStructure\": {\n          \"type\": \"string\"\n        }\n      },\n      \"required\": [\n        \"gameName\",\n        \"offers\",\n        \"payoutStructure\"\n      ]\n    }\n  }\n}",
            "sendBody": true,
            "sendHeaders": true,
            "specifyBody": "json",
            "authentication": "genericCredentialType",
            "genericAuthType": "httpQueryAuth",
            "headerParameters": {
              "parameters": [
                {
                  "name": "Content-Type",
                  "value": "application/json"
                }
              ]
            }
          },
          "credentials": {
            "httpQueryAuth": {
              "id": "CZHUfV9qSxpvy0iG",
              "name": "Gemini Query Auth - Storied"
            }
          },
          "typeVersion": 4.2
        },
        {
          "id": "27eb8307-b804-4d95-a54d-4e071d9b6222",
          "name": "Wait1",
          "type": "n8n-nodes-base.wait",
          "position": [
            3024,
            1200
          ],
          "webhookId": "f332191a-a4cf-4c4e-9290-38fcbcfb779a",
          "parameters": {},
          "typeVersion": 1.1
        },
        {
          "id": "af580632-5981-4824-9dc3-1f81e87d8f82",
          "name": "Sticky Note",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            2400,
            -720
          ],
          "parameters": {
            "color": 2,
            "width": 2368,
            "height": 1136,
            "content": "## AppStore and Play Store ID\n Get apps store and playstore iIDs"
          },
          "typeVersion": 1
        },
        {
          "id": "d8871fae-7a33-4a9c-a384-973210cc1ff3",
          "name": "Sticky Note2",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            4816,
            -736
          ],
          "parameters": {
            "color": 6,
            "width": 1344,
            "height": 1136,
            "content": "## Update sheet and notify"
          },
          "typeVersion": 1
        },
        {
          "id": "e4aae337-4af7-432d-bfd3-8c9ee9b37090",
          "name": "Sticky Note4",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            1504,
            480
          ],
          "parameters": {
            "width": 3536,
            "height": 896,
            "content": "## ARCHIVE ZONE\n"
          },
          "typeVersion": 1
        },
        {
          "id": "dd68cabb-0761-4ff9-a379-a4513c86c30c",
          "name": "Switch",
          "type": "n8n-nodes-base.switch",
          "position": [
            1040,
            -304
          ],
          "parameters": {
            "rules": {
              "values": [
                {
                  "conditions": {
                    "options": {
                      "version": 2,
                      "leftValue": "",
                      "caseSensitive": true,
                      "typeValidation": "strict"
                    },
                    "combinator": "and",
                    "conditions": [
                      {
                        "id": "c79dca4f-3b87-4d87-a2f0-b9b54e89b26c",
                        "operator": {
                          "type": "string",
                          "operation": "notEmpty",
                          "singleValue": true
                        },
                        "leftValue": "={{ $json.URL }}",
                        "rightValue": ""
                      }
                    ]
                  }
                },
                {
                  "conditions": {
                    "options": {
                      "version": 2,
                      "leftValue": "",
                      "caseSensitive": true,
                      "typeValidation": "strict"
                    },
                    "combinator": "and",
                    "conditions": [
                      {
                        "id": "51f8b42d-69fc-4d83-92d9-246fa904e093",
                        "operator": {
                          "type": "string",
                          "operation": "notEmpty",
                          "singleValue": true
                        },
                        "leftValue": "={{ $json[\"Upload file\"].filename }}",
                        "rightValue": ""
                      }
                    ]
                  }
                }
              ]
            },
            "options": {}
          },
          "typeVersion": 3.3
        },
        {
          "id": "2711430e-dc44-4e1f-bc26-eb4dcacd2805",
          "name": "Download Image",
          "type": "n8n-nodes-base.httpRequest",
          "notes": "Get the image from the url as a binary file",
          "position": [
            1600,
            1200
          ],
          "parameters": {
            "url": "={{ $json.URL }}",
            "options": {}
          },
          "typeVersion": 4.3
        },
        {
          "id": "ff903fd1-d53d-45bf-a56f-031f8329c949",
          "name": "Upload Binary File to Analyze",
          "type": "@n8n/n8n-nodes-langchain.googleGemini",
          "position": [
            1440,
            -128
          ],
          "parameters": {
            "resource": "file",
            "inputType": "binary",
            "binaryPropertyName": "Upload_file"
          },
          "credentials": {
            "googlePalmApi": {
              "id": "ICsyOYGneyPY6hP2",
              "name": "Gemini - STORIED"
            }
          },
          "typeVersion": 1
        },
        {
          "id": "188c52cb-b0ad-419d-ba5c-fbec5e5d0ab0",
          "name": "Upload File to Analyze as URL",
          "type": "@n8n/n8n-nodes-langchain.googleGemini",
          "position": [
            1472,
            -416
          ],
          "parameters": {
            "fileUrl": "={{ $json.URL }}",
            "resource": "file"
          },
          "credentials": {
            "googlePalmApi": {
              "id": "ICsyOYGneyPY6hP2",
              "name": "Gemini - STORIED"
            }
          },
          "typeVersion": 1
        },
        {
          "id": "affb12ac-1f6d-42c6-9e35-46dc6b91d849",
          "name": "Code in JavaScript",
          "type": "n8n-nodes-base.code",
          "position": [
            2480,
            -288
          ],
          "parameters": {
            "jsCode": "// Assume the input text is in $json.text\nconst rawText = $input.first().json.body.candidates[0].content.parts[0].text;\n\n// Parse the JSON string\nlet parsed;\ntry {\n  parsed = JSON.parse(rawText);\n} catch (e) {\n  throw new Error(\"Invalid JSON: \" + e.message);\n}\n\n// Return as n8n output\nreturn [{ json: parsed }];"
          },
          "typeVersion": 2
        },
        {
          "id": "dddad6c3-4b58-4dfd-9cef-26ebccff04f1",
          "name": "Google Gemini Chat Model4",
          "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
          "position": [
            4432,
            272
          ],
          "parameters": {
            "options": {}
          },
          "credentials": {
            "googlePalmApi": {
              "id": "Dcm6ikEvNE1dhGxo",
              "name": "Gemini API - Personal"
            }
          },
          "typeVersion": 1
        },
        {
          "id": "8158d674-6ea1-4efe-9221-c1cc84273490",
          "name": "Append or update row in sheet",
          "type": "n8n-nodes-base.googleSheets",
          "position": [
            5504,
            -480
          ],
          "parameters": {
            "columns": {
              "value": {
                "Game": "={{ $('Code in JavaScript').item.json.gameName }}",
                "App Store ID (iOS)": "=",
                "PlayStore ID (Android)": "={{ $('AI Agent1').item.json.output.gameID }}"
              },
              "schema": [
                {
                  "id": "Game",
                  "type": "string",
                  "display": true,
                  "removed": false,
                  "required": false,
                  "displayName": "Game",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "Offers",
                  "type": "string",
                  "display": true,
                  "required": false,
                  "displayName": "Offers",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "Payout Structure",
                  "type": "string",
                  "display": true,
                  "required": false,
                  "displayName": "Payout Structure",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "App Store ID (iOS)",
                  "type": "string",
                  "display": true,
                  "required": false,
                  "displayName": "App Store ID (iOS)",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "PlayStore ID (Android)",
                  "type": "string",
                  "display": true,
                  "required": false,
                  "displayName": "PlayStore ID (Android)",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                }
              ],
              "mappingMode": "defineBelow",
              "matchingColumns": [
                "Game"
              ],
              "attemptToConvertTypes": false,
              "convertFieldsToString": false
            },
            "options": {},
            "operation": "appendOrUpdate",
            "sheetName": {
              "__rl": true,
              "mode": "list",
              "value": "gid=0",
              "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oseH0iifhwegtlBU00PIzi9SF9MSbeop4V4hcxqVCfs/edit#gid=0",
              "cachedResultName": "GAMES/OFFERS"
            },
            "documentId": {
              "__rl": true,
              "mode": "list",
              "value": "1oseH0iifhwegtlBU00PIzi9SF9MSbeop4V4hcxqVCfs",
              "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oseH0iifhwegtlBU00PIzi9SF9MSbeop4V4hcxqVCfs/edit?usp=drivesdk",
              "cachedResultName": "Competitor Analysis"
            }
          },
          "credentials": {
            "googleSheetsOAuth2Api": {
              "id": "n434ebqBlO2QBh7B",
              "name": "Google Sheets account"
            }
          },
          "typeVersion": 4.7
        },
        {
          "id": "4e26b423-d542-42c7-b151-2c12c2fb24b3",
          "name": "Google Gemini Chat Model5",
          "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
          "position": [
            4416,
            -144
          ],
          "parameters": {
            "options": {}
          },
          "credentials": {
            "googlePalmApi": {
              "id": "Dcm6ikEvNE1dhGxo",
              "name": "Gemini API - Personal"
            }
          },
          "typeVersion": 1
        },
        {
          "id": "c7ba8807-deff-466d-b12b-d4c911479325",
          "name": "Switch1",
          "type": "n8n-nodes-base.switch",
          "position": [
            5168,
            -304
          ],
          "parameters": {
            "rules": {
              "values": [
                {
                  "conditions": {
                    "options": {
                      "version": 2,
                      "leftValue": "",
                      "caseSensitive": true,
                      "typeValidation": "strict"
                    },
                    "combinator": "and",
                    "conditions": [
                      {
                        "id": "4a31d56a-296e-47dd-aee0-a787ed53d048",
                        "operator": {
                          "type": "boolean",
                          "operation": "true",
                          "singleValue": true
                        },
                        "leftValue": "={{ $json.isEmpty() && $('AI Agent1').item.json.output.gameID.length > 0 }}",
                        "rightValue": ""
                      }
                    ]
                  }
                },
                {
                  "conditions": {
                    "options": {
                      "version": 2,
                      "leftValue": "",
                      "caseSensitive": true,
                      "typeValidation": "strict"
                    },
                    "combinator": "and",
                    "conditions": [
                      {
                        "id": "42af322a-2d41-4b6f-b9cf-da1ee71047d6",
                        "operator": {
                          "type": "boolean",
                          "operation": "true",
                          "singleValue": true
                        },
                        "leftValue": "={{ $json.isEmpty() && $('AI Agent2').item.json.output.gameID.length > 0 }}",
                        "rightValue": ""
                      }
                    ]
                  }
                }
              ]
            },
            "options": {}
          },
          "typeVersion": 3.3
        },
        {
          "id": "3b0988f4-6163-47d5-9546-796d79f1775a",
          "name": "Append or update row in sheet1",
          "type": "n8n-nodes-base.googleSheets",
          "position": [
            5504,
            -208
          ],
          "parameters": {
            "columns": {
              "value": {
                "Game": "={{ $('Code in JavaScript').item.json.gameName }}",
                "App Store ID (iOS)": "={{ $('AI Agent2').item.json.output.gameID }}",
                "PlayStore ID (Android)": "="
              },
              "schema": [
                {
                  "id": "Game",
                  "type": "string",
                  "display": true,
                  "removed": false,
                  "required": false,
                  "displayName": "Game",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "Offers",
                  "type": "string",
                  "display": true,
                  "required": false,
                  "displayName": "Offers",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "Payout Structure",
                  "type": "string",
                  "display": true,
                  "required": false,
                  "displayName": "Payout Structure",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "App Store ID (iOS)",
                  "type": "string",
                  "display": true,
                  "required": false,
                  "displayName": "App Store ID (iOS)",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                },
                {
                  "id": "PlayStore ID (Android)",
                  "type": "string",
                  "display": true,
                  "required": false,
                  "displayName": "PlayStore ID (Android)",
                  "defaultMatch": false,
                  "canBeUsedToMatch": true
                }
              ],
              "mappingMode": "defineBelow",
              "matchingColumns": [
                "Game"
              ],
              "attemptToConvertTypes": false,
              "convertFieldsToString": false
            },
            "options": {},
            "operation": "appendOrUpdate",
            "sheetName": {
              "__rl": true,
              "mode": "list",
              "value": "gid=0",
              "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oseH0iifhwegtlBU00PIzi9SF9MSbeop4V4hcxqVCfs/edit#gid=0",
              "cachedResultName": "GAMES/OFFERS"
            },
            "documentId": {
              "__rl": true,
              "mode": "list",
              "value": "1oseH0iifhwegtlBU00PIzi9SF9MSbeop4V4hcxqVCfs",
              "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1oseH0iifhwegtlBU00PIzi9SF9MSbeop4V4hcxqVCfs/edit?usp=drivesdk",
              "cachedResultName": "Competitor Analysis"
            }
          },
          "credentials": {
            "googleSheetsOAuth2Api": {
              "id": "n434ebqBlO2QBh7B",
              "name": "Google Sheets account"
            }
          },
          "typeVersion": 4.7
        }
      ],
      "pinData": {
        "Analyze": [
          {
            "body": {
              "candidates": [
                {
                  "content": {
                    "role": "model",
                    "parts": [
                      {
                        "text": "{\n  \"gameName\": \"Dice Dreams\",\n  \"offers\": \"Reach level 10\",\n  \"payoutStructure\": \"$780.00\"\n}"
                      }
                    ]
                  },
                  "avgLogprobs": -0.0025509560480713846,
                  "finishReason": "STOP"
                }
              ],
              "responseId": "A0cwaa_uIsDwjrEPnL6nSA",
              "modelVersion": "gemini-2.0-flash-exp",
              "usageMetadata": {
                "totalTokenCount": 2531,
                "promptTokenCount": 2491,
                "promptTokensDetails": [
                  {
                    "modality": "IMAGE",
                    "tokenCount": 2322
                  },
                  {
                    "modality": "TEXT",
                    "tokenCount": 169
                  }
                ],
                "candidatesTokenCount": 40,
                "candidatesTokensDetails": [
                  {
                    "modality": "TEXT",
                    "tokenCount": 40
                  }
                ]
              }
            },
            "headers": {
              "date": "Wed, 03 Dec 2025 14:19:49 GMT",
              "vary": "Origin, X-Origin, Referer",
              "server": "scaffolding on HTTPServer2",
              "connection": "close",
              "content-type": "application/json; charset=UTF-8",
              "server-timing": "gfet4t7; dur=1552",
              "x-frame-options": "SAMEORIGIN",
              "x-xss-protection": "0",
              "transfer-encoding": "chunked",
              "x-content-type-options": "nosniff"
            },
            "statusCode": 200,
            "statusMessage": "OK"
          }
        ],
        "Code in JavaScript": [
          {
            "offers": "Reach level 10",
            "gameName": "Dice Dreams",
            "payoutStructure": "$780.00"
          }
        ],
        "On form submission": [
          {
            "URL": "https://www.sidehustlenation.com/wp-content/uploads/2024/12/Freecash-Review-is-it-legit-and-safe-7.jpg",
            "formMode": "test",
            "Upload file": null,
            "submittedAt": "2025-12-03T17:24:26.479+03:00"
          }
        ],
        "Upload video Gemini": [
          {
            "file": {
              "uri": "https://generativelanguage.googleapis.com/v1beta/files/7whopq8rwtt8",
              "name": "files/7whopq8rwtt8",
              "state": "PROCESSING",
              "source": "UPLOADED",
              "mimeType": "video/mp4",
              "sizeBytes": "933141",
              "createTime": "2025-04-28T18:12:40.864881Z",
              "sha256Hash": "MWQwYmQ2YWViYmRiNDNjZTYyY2I2ODhkOWRlNzdlMzkyZDJkMTU0NTM5NTE1OWM2MTJlMWRiNTNhNTIyZDVmZA==",
              "updateTime": "2025-04-28T18:12:40.864881Z",
              "expirationTime": "2025-04-30T18:12:40.834671218Z"
            }
          }
        ],
        "Analyze video Gemini": [
          {
            "candidates": [
              {
                "content": {
                  "role": "model",
                  "parts": [
                    {
                      "text": "Okay, here's a detailed description of the video:\n\n**Overview**\nThe video is a promotional piece for Advanced Sim Racing, featuring a high-end BMW-branded racing simulator setup at a BMW dealership event. It also highlights the presence of a well-known personality: Georges St-Pierre (GSP). The video mixes detailed close-ups of the equipment, shots of people interacting with the simulator, and branding elements.\n\n**Detailed Description:**\n\n*   **0:00-0:01:** Opens with a dynamic shot of someone using the advanced racing simulator. We see triple monitors displaying a race, and the participant grips the steering wheel with intent. The seat is black, with \"OMP\" branded at the top, \"ADVANCED Sim Racing\" and a large BMW logo prominently displayed on its back.\n\n*   **0:01-0:03:** Tight focus on the steering wheel, emphasizing its sophisticated design and multiple buttons.  We see the brand name \"OMP\" on the wheel itself, while the backboard is adorned with the company’s slogan, “ADVANCED Sim Racing”.\n\n*   **0:03-0:07:** We shift to show the simulator being used at a BMW dealership.  A group of people gathers around with the hood open of a BMW car, seemingly intrigued and looking at the person experiencing the simulator.\n\n*   **0:07-0:11:** George St-Pierre appears among the crowd.\n\n*   **0:11-0:13:** Close-up of the SimuCube motor\n\n*   **0:13-0:15:** George St-Pierre gets onto the simulator while people assist him.\n\n*   **0:15-0:21:** Focus on the haptic feedback engine and the back of an employee’s t-shirt that says “ADVANCED Sim Racing DBOX SIMUCUBE”\n\n*   **0:22-0:24:** Small lego replica of the BMW 3 series next to one of the monitor’s along with the car’s front side view with distinct headlights.\n\n*   **0:24-0:25:** The outside of the event, labeled BMW Laval with the BMW logo, ice cream booth nearby.\n\n*   **0:25-0:27:** More participants getting on the simulator\n\n*   **0:27-0:29:** The ranking for different drivers\n\n*   **0:29-0:33:** View of the racing pedals and the race seat with the “OMP” brand.\n\n**Key Elements & Equipment**\n*   **Sim Racing Rig:** A highly advanced racing simulator is central to the video.  It is equipped with a racing seat, steering wheel, pedals, multiple monitors and a SimuCube haptic engine for feedback\n*   **BMW Branding:** The presence of the BMW logo and the incorporation of BMW vehicles underscore the affiliation.\n\n**Style & Tone:**\n*   **High-Tech:**  The video conveys a sense of sophisticated technology and realistic immersion in simulated racing.\n*   **Promotional/Enthusiastic:**  The music and the editing suggest excitement and interest in the product.\n*   **Stylish:** Use of slow-motion shots, close-ups and selective focus adds a modern, visually appealing look.\n\nI hope this helps!"
                    }
                  ]
                },
                "avgLogprobs": -1.1206862455033986,
                "finishReason": "STOP"
              }
            ],
            "modelVersion": "gemini-2.0-flash-exp",
            "usageMetadata": {
              "totalTokenCount": 10149,
              "promptTokenCount": 9441,
              "promptTokensDetails": [
                {
                  "modality": "TEXT",
                  "tokenCount": 36
                },
                {
                  "modality": "AUDIO",
                  "tokenCount": 825
                },
                {
                  "modality": "VIDEO",
                  "tokenCount": 8580
                }
              ],
              "candidatesTokenCount": 708,
              "candidatesTokensDetails": [
                {
                  "modality": "TEXT",
                  "tokenCount": 708
                }
              ]
            }
          }
        ],
        "Upload File to Analyze as URL": [
          {
            "fileUri": "https://generativelanguage.googleapis.com/v1beta/files/a66v2axmdam5",
            "mimeType": "image/jpeg"
          }
        ]
      },
      "connections": {
        "If1": {
          "main": [
            [
              {
                "node": "Aggregate",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "If2": {
          "main": [
            []
          ]
        },
        "If3": {
          "main": [
            [
              {
                "node": "Analyze video",
                "type": "main",
                "index": 0
              }
            ],
            [
              {
                "node": "Download video",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Code": {
          "main": [
            [
              {
                "node": "Upload",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "HTML": {
          "main": [
            [
              {
                "node": "Code in Python (Native) (Beta)",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Wait": {
          "main": [
            [
              {
                "node": "Analyze video Gemini",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "HTML1": {
          "main": [
            [
              {
                "node": "Code in Python (Native) (Beta)1",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Merge": {
          "main": [
            [
              {
                "node": "Switch1",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Wait1": {
          "main": [
            []
          ]
        },
        "Switch": {
          "main": [
            [
              {
                "node": "Upload File to Analyze as URL",
                "type": "main",
                "index": 0
              }
            ],
            [
              {
                "node": "Upload Binary File to Analyze",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Upload": {
          "main": [
            [
              {
                "node": "Wait1",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Analyze": {
          "main": [
            [
              {
                "node": "Code in JavaScript",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Switch1": {
          "main": [
            [
              {
                "node": "Append or update row in sheet",
                "type": "main",
                "index": 0
              }
            ],
            [
              {
                "node": "Append or update row in sheet1",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "AI Agent": {
          "main": [
            []
          ]
        },
        "AI Agent1": {
          "main": [
            [
              {
                "node": "Get row(s) in sheet",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "AI Agent2": {
          "main": [
            [
              {
                "node": "Get row(s) in sheet1",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "AI Agent3": {
          "main": [
            []
          ]
        },
        "Aggregate": {
          "main": [
            []
          ]
        },
        "Split Out": {
          "main": [
            [
              {
                "node": "If1",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Aggregate1": {
          "main": [
            [
              {
                "node": "AI Agent2",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Aggregate2": {
          "main": [
            [
              {
                "node": "AI Agent1",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Get iOS App": {
          "main": [
            [
              {
                "node": "HTML",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Analyze video": {
          "main": [
            [
              {
                "node": "AI Agent3",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Download Image": {
          "main": [
            [
              {
                "node": "initiateUpload",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Download video": {
          "main": [
            [
              {
                "node": "Initiated Gemini Upload",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "initiateUpload": {
          "main": [
            [
              {
                "node": "Code",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Get Android App": {
          "main": [
            [
              {
                "node": "HTML1",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "OpenAI Chat Model": {
          "ai_languageModel": [
            [
              {
                "node": "AI Agent",
                "type": "ai_languageModel",
                "index": 0
              }
            ]
          ]
        },
        "Code in JavaScript": {
          "main": [
            [
              {
                "node": "Append row in sheet",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "On form submission": {
          "main": [
            [
              {
                "node": "Switch",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Append row in sheet": {
          "main": [
            [
              {
                "node": "Get Android App",
                "type": "main",
                "index": 0
              },
              {
                "node": "Get iOS App",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Get row(s) in sheet": {
          "main": [
            [
              {
                "node": "Merge",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Upload video Gemini": {
          "main": [
            [
              {
                "node": "Wait",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Analyze video Gemini": {
          "main": [
            [
              {
                "node": "Get Result",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Get row(s) in sheet1": {
          "main": [
            [
              {
                "node": "Merge",
                "type": "main",
                "index": 1
              }
            ]
          ]
        },
        "Google Gemini Chat Model": {
          "ai_languageModel": [
            [
              {
                "node": "AI Agent",
                "type": "ai_languageModel",
                "index": 1
              }
            ]
          ]
        },
        "Structured Output Parser": {
          "ai_outputParser": [
            [
              {
                "node": "AI Agent",
                "type": "ai_outputParser",
                "index": 0
              }
            ]
          ]
        },
        "Google Gemini Chat Model1": {
          "ai_languageModel": [
            [
              {
                "node": "AI Agent3",
                "type": "ai_languageModel",
                "index": 0
              }
            ]
          ]
        },
        "Google Gemini Chat Model2": {
          "ai_languageModel": [
            [
              {
                "node": "AI Agent1",
                "type": "ai_languageModel",
                "index": 0
              }
            ]
          ]
        },
        "Google Gemini Chat Model3": {
          "ai_languageModel": [
            [
              {
                "node": "AI Agent2",
                "type": "ai_languageModel",
                "index": 0
              }
            ]
          ]
        },
        "Google Gemini Chat Model4": {
          "ai_languageModel": [
            [
              {
                "node": "Structured Output Parser3",
                "type": "ai_languageModel",
                "index": 0
              }
            ]
          ]
        },
        "Google Gemini Chat Model5": {
          "ai_languageModel": [
            [
              {
                "node": "Structured Output Parser2",
                "type": "ai_languageModel",
                "index": 0
              }
            ]
          ]
        },
        "Structured Output Parser2": {
          "ai_outputParser": [
            [
              {
                "node": "AI Agent1",
                "type": "ai_outputParser",
                "index": 0
              }
            ]
          ]
        },
        "Structured Output Parser3": {
          "ai_outputParser": [
            [
              {
                "node": "AI Agent2",
                "type": "ai_outputParser",
                "index": 0
              }
            ]
          ]
        },
        "Structured Output Parser4": {
          "ai_outputParser": [
            [
              {
                "node": "AI Agent3",
                "type": "ai_outputParser",
                "index": 0
              }
            ]
          ]
        },
        "Append or update row in sheet": {
          "main": [
            [
              {
                "node": "Send a message",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Upload Binary File to Analyze": {
          "main": [
            [
              {
                "node": "Analyze",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Upload File to Analyze as URL": {
          "main": [
            [
              {
                "node": "Analyze",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Append or update row in sheet1": {
          "main": [
            [
              {
                "node": "Send a message",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Code in Python (Native) (Beta)": {
          "main": [
            [
              {
                "node": "Aggregate1",
                "type": "main",
                "index": 0
              }
            ]
          ]
        },
        "Code in Python (Native) (Beta)1": {
          "main": [
            [
              {
                "node": "Aggregate2",
                "type": "main",
                "index": 0
              }
            ]
          ]
        }
      }
    }