AutomationFlowsAI & RAG › Transform Product Photos Into Ad Campaigns with Gemini Vision and Claude via…

Transform Product Photos Into Ad Campaigns with Gemini Vision and Claude via…

Original n8n title: Transform Product Photos Into Ad Campaigns with Gemini Vision and Claude via Telegram

ByAlvin Chandra @alvin on n8n.io

Turn amateur product snapshots into high-conversion advertising assets automatically. This agentic workflow acts as your personal Art Director. Simply send a photo to a Telegram bot, and the AI will analyze the image, conceptualize 3 distinct marketing angles, and generate…

Event trigger★★★★☆ complexityAI-powered21 nodesOutput Parser StructuredTool ThinkTelegram TriggerTelegramGoogle GeminiAgentHTTP RequestOpenRouter Chat
AI & RAG Trigger: Event Nodes: 21 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #11190 — we link there as the canonical source.

This workflow follows the Agent → Googlegemini recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "nodes": [
    {
      "id": "1c87068a-0c40-41a8-8c79-515a81644296",
      "name": "Main Sticky",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        304
      ],
      "parameters": {
        "color": 4,
        "width": 500,
        "height": 600,
        "content": "## \ud83d\udcf8 AI Ad Creative Generator\nTurn simple product photos into fully realized ad concepts using Gemini Vision and Image Generation.\n\n### How it works\nThis workflow acts as an automated Art Director living in your Telegram.\n1. **Ingest & Verify:** The workflow triggers when you send a photo to your Telegram bot. It verifies your User ID to ensure only you can use the credits.\n2. **Analyze:** **Gemini Vision** looks at the photo to understand the product, context, and lighting.\n3. **Brainstorm:** An **AI Agent** takes the vision analysis and generates a creative ad campaign concept, including a marketing rationale and a specific image generation prompt.\n4. **Generate:** The workflow uses **Gemini's Image Generation** capabilities to create a visual mock-up of the ad concept.\n5. **Deliver:** The resulting ad creative is sent back to you instantly on Telegram.\n\n### Setup steps\n1. **Telegram:** Create a bot via BotFather. Get the Token and your personal User ID (via @userinfobot).\n2. **Config:** Open the **CONFIG** node (Green) and enter your `authorized_user_id`.\n3. **Credentials:** \n   - Add your **Telegram Bot Token** in the Trigger and Sender nodes.\n   - Add your **Google Gemini API Key** in the Gemini nodes.\n4. **Activate:** toggle the workflow to 'Active' and send your bot a picture!"
      },
      "typeVersion": 1
    },
    {
      "id": "b7579b9c-3c4e-4cdc-a842-ba5190838bd2",
      "name": "Section 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        576
      ],
      "parameters": {
        "color": 7,
        "width": 1080,
        "height": 280,
        "content": "## 1. Receive & Authenticate\nValidates the user and extracts the image file path."
      },
      "typeVersion": 1
    },
    {
      "id": "8c846af1-3b76-4a82-b127-51bd25da9ca4",
      "name": "Section 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1456,
        576
      ],
      "parameters": {
        "color": 7,
        "width": 700,
        "height": 520,
        "content": "## 2. AI Analysis & Strategy\nGemini Vision analyzes the product, and the Agent plans the campaign."
      },
      "typeVersion": 1
    },
    {
      "id": "587e724e-865d-4a91-8510-5da28e49c9f6",
      "name": "Section 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2192,
        576
      ],
      "parameters": {
        "color": 7,
        "width": 1360,
        "height": 280,
        "content": "## 3. Generate & Deliver\nCreates the new ad visual and sends the result back to Telegram."
      },
      "typeVersion": 1
    },
    {
      "id": "83eb30bb-09a5-4033-935e-d4616425344c",
      "name": "CONFIG",
      "type": "n8n-nodes-base.set",
      "position": [
        608,
        672
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "83f8db84-b878-4bc1-bfdb-81c718dd88fa",
              "name": "authorized_user_id",
              "type": "string",
              "value": ""
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "71b36b61-d66c-4273-bb6c-580ce41bac60",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1984,
        912
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"agent_thought_process\": \"To capture 'electric energy' for an energy drink...\",\n  \"ad_campaigns\": [\n    {\n      \"concept_title\": \"Cyberpunk Neon City\",\n      \"marketing_rationale\": \"High-contrast neon colors...\",\n      \"nbp_prompt\": \"A futuristic cyberpunk street scene...\",\n      \"aspect_ratio\": \"4:5\"\n    }\n  ]\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "3a841f59-bd0b-44fc-b6f0-26b0e00f55e6",
      "name": "think_tool",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        1840,
        912
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "5b36c4fa-793d-4be3-8707-16ae14f200b0",
      "name": "On New Message",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        384,
        672
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d162014d-d91b-4b58-9cde-790091f26466",
      "name": "Auth: Verify User ID",
      "type": "n8n-nodes-base.if",
      "position": [
        816,
        672
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "f841a208-4542-450c-b0e5-2a3072719c47",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.message.from.id }}",
              "rightValue": "={{ $('CONFIG').item.json.authorized_user_id }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "de765dbc-530e-433f-830c-fb4a963a3687",
      "name": "Get Photo File Path",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1264,
        672
      ],
      "parameters": {
        "fileId": "={{ $json.message.photo[1].file_id }}",
        "resource": "file",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "b99938b7-70e4-4921-b367-42afdc706b22",
      "name": "Check: Has Photo?",
      "type": "n8n-nodes-base.if",
      "position": [
        1040,
        672
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "1b2c96de-35f8-429d-9604-f2d48bcde65f",
              "operator": {
                "type": "array",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.message.photo }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "4c0838bd-d90b-4421-9764-d5c06b91ff43",
      "name": "Gemini Vision: Analyze",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        1488,
        672
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-pro-vision",
          "cachedResultName": "models/gemini-pro-vision"
        },
        "options": {},
        "resource": "image",
        "inputType": "binary",
        "operation": "analyze"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0b6bb216-f6be-477c-8e55-1e3826f4a825",
      "name": "Creative Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1696,
        672
      ],
      "parameters": {
        "text": "=Input:\n\nUser Brief\n{{ $('On New Message').item.json.message.caption }}\n\nImage Desc\n{{ $json.content.parts[0].text }}\n\n",
        "options": {
          "systemMessage": "=IDENTITY\nYou are Creative Agent, an elite Art Director and AI Prompt Specialist..."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3
    },
    {
      "id": "141ae27c-947b-4610-b048-5d226f238c04",
      "name": "Loop: Ad Variations",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2048,
        672
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "output.ad_campaigns"
      },
      "typeVersion": 1
    },
    {
      "id": "1b63c002-6be4-464d-9d08-4e05a5a0be91",
      "name": "Config: Source URL",
      "type": "n8n-nodes-base.set",
      "position": [
        2256,
        672
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f83d33be-7f92-4480-af63-b2414aefe40c",
              "name": "input_url",
              "type": "string",
              "value": "=https://api.telegram.org/file/bot{{ $('CONFIG').item.json.telegram_bot_token }}/{{ $('Get Photo File Path').item.json.result.file_path }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "412ec0e5-8296-43fc-b6cf-aa7b2bdcb80c",
      "name": "HTTP: Download Source",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2480,
        672
      ],
      "parameters": {
        "url": "={{ $json.input_url }}",
        "options": {}
      },
      "typeVersion": 4.3
    },
    {
      "id": "764e4408-f491-4893-ae63-d3ae003ad8b6",
      "name": "Data: Binary Prep",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        2704,
        672
      ],
      "parameters": {
        "options": {},
        "operation": "binaryToPropery"
      },
      "typeVersion": 1
    },
    {
      "id": "886d8562-0367-4330-9574-5ae6a547e0d8",
      "name": "HTTP: Generate Image",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2928,
        672
      ],
      "parameters": {
        "url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-3-pro-image-preview:streamGenerateContent",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"contents\": [\n    {\n      \"role\": \"user\",\n      \"parts\": [\n        {\n          \"text\": {{ $('Loop: Ad Variations').item.json.nbp_prompt.toJsonString() }}\n        },\n{\n          \"inline_data\": {\n            \"mime_type\": \"image/jpeg\",\n            \"data\": {{ $json.data.toJsonString() }}\n          }\n        }\n      ]\n    }\n  ],\n  \"generationConfig\": {\n    \"responseModalities\": [\n      \"IMAGE\",\n      \"TEXT\"\n    ],\n    \"imageConfig\": {\n      \"image_size\": \"1K\"\n    }\n  },\n  \"tools\": [\n    {\n      \"googleSearch\": {}\n    }\n  ]\n}",
        "sendBody": true,
        "sendQuery": true,
        "specifyBody": "json",
        "queryParameters": {
          "parameters": [
            {
              "name": "key",
              "value": "={{ $('CONFIG').item.json.google_api_key }}"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "12d27559-32cb-431f-9bc8-a720a0ccabce",
      "name": "Data: Convert Response",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        3136,
        672
      ],
      "parameters": {
        "options": {},
        "operation": "toBinary",
        "sourceProperty": "candidates[0].content.parts[0].inlineData.data"
      },
      "typeVersion": 1.1
    },
    {
      "id": "7f39197d-d156-4d02-b5af-4736c8d8c41c",
      "name": "Telegram: Send Result",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3360,
        672
      ],
      "parameters": {
        "chatId": "={{ $('On New Message').item.json.message.from.id }}",
        "operation": "sendPhoto",
        "binaryData": true,
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ff25d564-75b5-41af-bc81-9c3f71856906",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1696,
        912
      ],
      "parameters": {
        "model": "anthropic/claude-sonnet-4.5",
        "options": {}
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "CONFIG": {
      "main": [
        [
          {
            "node": "Auth: Verify User ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "think_tool": {
      "ai_tool": [
        [
          {
            "node": "Creative Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Creative Agent": {
      "main": [
        [
          {
            "node": "Loop: Ad Variations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On New Message": {
      "main": [
        [
          {
            "node": "CONFIG",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check: Has Photo?": {
      "main": [
        [
          {
            "node": "Get Photo File Path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Data: Binary Prep": {
      "main": [
        [
          {
            "node": "HTTP: Generate Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Config: Source URL": {
      "main": [
        [
          {
            "node": "HTTP: Download Source",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Photo File Path": {
      "main": [
        [
          {
            "node": "Gemini Vision: Analyze",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop: Ad Variations": {
      "main": [
        [
          {
            "node": "Config: Source URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Auth: Verify User ID": {
      "main": [
        [
          {
            "node": "Check: Has Photo?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP: Generate Image": {
      "main": [
        [
          {
            "node": "Data: Convert Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP: Download Source": {
      "main": [
        [
          {
            "node": "Data: Binary Prep",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Creative Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Data: Convert Response": {
      "main": [
        [
          {
            "node": "Telegram: Send Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini Vision: Analyze": {
      "main": [
        [
          {
            "node": "Creative Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Creative Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Turn amateur product snapshots into high-conversion advertising assets automatically. This agentic workflow acts as your personal Art Director. Simply send a photo to a Telegram bot, and the AI will analyze the image, conceptualize 3 distinct marketing angles, and generate…

Source: https://n8n.io/workflows/11190/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Generate AI viral videos with NanoBanana & VEO3, shared on socials via Blotato 2. Uses @blotato/n8n-nodes-blotato, googleSheets, lmChatOpenAi, toolThink. Event-driven trigger; 94 nodes.

@Blotato/N8N Nodes Blotato, Google Sheets, OpenAI Chat +9
AI & RAG

RAG CHATBOT Main. Uses telegram, telegramTrigger, lmChatOpenAi, n8n-nodes-mcp. Event-driven trigger; 87 nodes.

Telegram, Telegram Trigger, OpenAI Chat +8
AI & RAG

Creators, marketers, and brands that want to turn a single product photo into premium motion clips, then optionally publish to Instagram/TikTok/YouTube via LATE. No editing skills required.

Telegram, Agent Tool, Telegram Trigger +5
AI & RAG

Product to Social Video (xCodeWraith Edition). Uses telegram, agentTool, telegramTrigger, httpRequest. Event-driven trigger; 83 nodes.

Telegram, Agent Tool, Telegram Trigger +5
AI & RAG

This workflow transforms your Telegram bot into an intelligent creative assistant. It can chat conversationally, fetch trending image prompts from PromptHero for inspiration, or perform a deep "remix"

Telegram Trigger, Output Parser Structured, Telegram +6