This workflow corresponds to n8n.io template #11446 — we link there as the canonical source.
This workflow follows the Googlegemini → HTTP Request 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 →
{
"meta": {
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "c26a923b-27d6-4c88-8645-9febd173c5f2",
"name": "Download Image File",
"type": "n8n-nodes-base.telegram",
"position": [
-64,
2560
],
"parameters": {
"fileId": "={{ $json.message.photo[0].file_id }}",
"resource": "file",
"additionalFields": {}
},
"typeVersion": 1.2
},
{
"id": "ea23ea5e-77d0-45e2-ad12-31635a814d5b",
"name": "Send Image",
"type": "n8n-nodes-base.telegram",
"position": [
1712,
2544
],
"parameters": {
"chatId": "={{ $('Telegram Trigger ').first().json.message.from.id }}",
"operation": "sendPhoto",
"binaryData": true,
"additionalFields": {}
},
"typeVersion": 1.2
},
{
"id": "bf9b0358-0d5e-416b-8697-1e4b007b4ddb",
"name": "Main Overview",
"type": "n8n-nodes-base.stickyNote",
"position": [
-960,
2336
],
"parameters": {
"width": 420,
"height": 552,
"content": "## \ud83c\udfa8 AI Product Ad Generator via Telegram\n\n### How it works\nSend a product image with caption text to your Telegram bot. The workflow uses Google's Nano Banana Pro AI to analyze your image, extract caption text, generate professional design instructions, and return a commercial-grade advertisement.\n\n### Setup steps\n1. **Telegram Bot API**: Create a Telegram bot via BotFather and add the API token to n8n credentials.\n2. **Google Gemini API**: Enable the Generative Language API in Google Cloud Console and add your API key.\n3. **Test**: Send a product image with caption text to your bot and receive the enhanced ad.\n\n### Key features\n- Preserves original product 100% (no alterations)\n- Uses only your caption text\n- Generates luxury-brand-quality designs\n- Outputs Instagram & Pinterest-ready images"
},
"typeVersion": 1
},
{
"id": "3e96b2db-8003-4639-956e-4a565f947707",
"name": "Input Section",
"type": "n8n-nodes-base.stickyNote",
"position": [
-288,
2320
],
"parameters": {
"color": 2,
"width": 280,
"height": 100,
"content": "## \ud83d\udce5 Telegram Input\nReceives images & captions, downloads file for processing."
},
"typeVersion": 1
},
{
"id": "c74e8ac0-36cd-4f16-8d6f-0039db0a70fe",
"name": "AI Processing",
"type": "n8n-nodes-base.stickyNote",
"position": [
144,
2320
],
"parameters": {
"color": 2,
"width": 320,
"height": 116,
"content": "## \ud83e\udd16 AI Analysis\nConverts image to base64. Gemini AI extracts caption text & generates detailed design instructions."
},
"typeVersion": 1
},
{
"id": "a41e34e0-4646-4b9f-ba3e-97717d071f2d",
"name": "Data Preparation",
"type": "n8n-nodes-base.stickyNote",
"position": [
640,
2320
],
"parameters": {
"color": 2,
"width": 320,
"height": 100,
"content": "## \ud83d\udd27 Payload Setup\nCombines image & analysis. Prepares structured API request for Nano Banana Pro."
},
"typeVersion": 1
},
{
"id": "d90dfd19-005d-4d33-8656-e55ba5780e7b",
"name": "Image Generation",
"type": "n8n-nodes-base.stickyNote",
"position": [
1088,
2320
],
"parameters": {
"color": 2,
"width": 380,
"height": 100,
"content": "## \ud83c\udfaf Generate & Convert\nSends request to Nano Banana Pro API. Converts base64 response to binary image files."
},
"typeVersion": 1
},
{
"id": "10301d31-2a8c-4df4-bdbf-fa0e028eab80",
"name": "Output Section",
"type": "n8n-nodes-base.stickyNote",
"position": [
1664,
2320
],
"parameters": {
"color": 2,
"height": 100,
"content": "## \ud83d\udce4 Telegram Output\nSends enhanced ad image back to user."
},
"typeVersion": 1
},
{
"id": "f66a2554-12ea-4d57-b41a-72e326641623",
"name": "Image to Base65",
"type": "n8n-nodes-base.extractFromFile",
"position": [
336,
2464
],
"parameters": {
"options": {},
"operation": "binaryToPropery"
},
"typeVersion": 1
},
{
"id": "0f9fc658-bb31-47f5-a2ac-d833e85a5c05",
"name": "Telegram Trigger ",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-272,
2560
],
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"typeVersion": 1.2
},
{
"id": "72ea5420-92ef-4e06-aab9-f9a8914680a7",
"name": "AI Design Analysis ",
"type": "@n8n/n8n-nodes-langchain.googleGemini",
"position": [
336,
2656
],
"parameters": {
"text": "={\n \"system_prompt\": \"You are an elite creative director specializing in viral product advertisements with 15+ years of experience in luxury brand campaigns. Transform product images into commercial-grade advertisements that stop scrollers and drive conversions.\",\n \n \"instructions\": {\n \"core_rules\": [\n \"Keep the original product 100% unchanged - no alterations, replacements, or distortions\",\n \"Extract and use ONLY text provided in the user's caption\",\n \"If no relevant text exists in caption, leave text fields empty - NEVER generate AI taglines\",\n \"Focus on premium visual enhancement and commercial photography techniques\",\n \"Create Instagram-worthy, conversion-focused advertisements\"\n ],\n \n \"caption_parsing\": {\n \"instruction\": \"Carefully parse the caption: {{ $('Telegram Trigger ').item.json.message.caption }}\",\n \"extraction_rules\": {\n \"headline\": \"Extract main title, product name, or primary heading (usually first line or capitalized text)\",\n \"subheadline\": \"Extract secondary heading, tagline, or supporting text\",\n \"description\": \"Extract product details, features, or body text\",\n \"call_to_action\": \"Extract action phrases like 'Shop Now', 'Buy Today', 'Limited Offer', etc.\",\n \"fallback\": \"If no text exists for a field, return empty string - DO NOT create artificial content\"\n }\n },\n \n \"output_format\": {\n \"type\": \"JSON\",\n \"structure\": {\n \"headline\": \"string (from caption only, or empty)\",\n \"subheadline\": \"string (from caption only, or empty)\",\n \"description\": \"string (from caption only, or empty)\",\n \"call_to_action\": \"string (from caption only, or empty)\",\n \"design_suggestions\": \"string (detailed visual concept, 400+ words)\"\n }\n },\n \n \"design_suggestions_blueprint\": {\n \"word_count\": \"400-600 words minimum\",\n \"sections\": [\n {\n \"name\": \"HERO SHOT COMPOSITION\",\n \"guidelines\": [\n \"Position product as the absolute focal point using rule of thirds (place key element at intersection points)\",\n \"Apply golden ratio (1.618:1) for proportional balance\",\n \"Create generous negative space (40-50% of frame) for breathing room\",\n \"Layer composition: sharp product in middle ground, soft-focus foreground elements (if applicable), blurred background\",\n \"Use leading lines to guide eye toward product\",\n \"Ensure product occupies 25-40% of frame for optimal impact\"\n ]\n },\n {\n \"name\": \"PREMIUM LIGHTING SETUP\",\n \"guidelines\": [\n \"KEY LIGHT: Position at 45\u00b0 angle, slightly above product, intensity 100% to define form\",\n \"FILL LIGHT: Opposite side at 30\u00b0 angle, 40-50% intensity to soften shadows\",\n \"RIM LIGHT: Behind product at 135\u00b0 angle, 60-80% intensity for edge separation and premium glow\",\n \"BACKGROUND LIGHT: Soft graduated lighting on background, 30-40% intensity\",\n \"Color temperature: Warm highlights (3000-3200K golden hour tone) + Cool shadows (5400-5600K slight blue cast) for dimensional depth\",\n \"Soft shadows with 70-80% opacity, 10-15 pixel blur for natural fall-off\",\n \"Add subtle lens flare or light streaks if appropriate for lifestyle feel\"\n ]\n },\n {\n \"name\": \"LUXURY BACKGROUND SELECTION\",\n \"options\": [\n \"MINIMALIST ELEGANCE: Clean white-to-light-gray gradient (5\u00b0 angle), subtle paper texture overlay at 8% opacity, micro-shadows for depth\",\n \"MARBLE LUXURY: Polished Carrara or Calacatta marble surface, natural gray veining, glossy finish with 40% reflection of product\",\n \"FABRIC SOPHISTICATION: Flowing silk, velvet, or linen in complementary colors (analogous to product), elegant draping with soft folds\",\n \"INDUSTRIAL MODERN: Brushed stainless steel, matte concrete, or frosted glass with gradient lighting, modern and sleek\",\n \"NATURAL ORGANIC: Light oak wood grain, smooth river stone, or terrazzo surface with warm tones\",\n \"GRADIENT ATMOSPHERE: Soft color wash from complementary palette, bokeh light particles, dreamlike quality\"\n ],\n \"selection_criteria\": \"Choose based on product category (tech=minimal/industrial, beauty=marble/fabric, food=natural/wood, fashion=fabric/minimal)\"\n },\n {\n \"name\": \"CINEMATIC COLOR GRADING\",\n \"color_science\": [\n \"PRIMARY CORRECTION: Boost product's natural colors by 18-22% saturation, increase vibrancy by 15%\",\n \"SECONDARY CORRECTION: Desaturate background by 12-18% to create visual hierarchy\",\n \"SHADOW TONES: Add cool blue-teal tint (temperature -8 to -12) for depth and dimension\",\n \"HIGHLIGHT TONES: Warm golden-amber tint (temperature +8 to +15) for premium feel\",\n \"MID-TONES: Slight magenta shift (+3 to +5 tint) for richness\",\n \"CONTRAST: Increase overall contrast by 20-25% using S-curve adjustment\",\n \"CLARITY: Boost mid-tone contrast by 15-20% on product only\",\n \"FILM LOOK: Add subtle grain (ISO 400 equivalent) at 3-5% for organic texture\"\n ],\n \"color_harmony\": \"Ensure background uses complementary or analogous colors to product, 60-30-10 color distribution rule (60% background, 30% product, 10% accents)\"\n },\n {\n \"name\": \"VISUAL EFFECTS & POLISH\",\n \"effects_list\": [\n \"DEPTH OF FIELD: Simulate f/2.8 aperture - product tack-sharp, background softly blurred (Gaussian blur 25-40px radius)\",\n \"PRODUCT REFLECTION: Create subtle mirror reflection below product at 25-35% opacity, fade to transparent, slight blur\",\n \"SHADOW CASTING: Natural contact shadow directly beneath product (95% black, 5-8px blur, 70% opacity)\",\n \"AMBIENT SHADOW: Larger, softer surrounding shadow (30-40% opacity, 50-80px blur) for grounding\",\n \"RIM GLOW: Subtle luminous outline on product edges (1-2px, 40-60% opacity, color matched to rim light)\",\n \"ATMOSPHERIC PARTICLES: Optional floating dust particles or light bokeh (20-30% opacity) for magical quality\",\n \"LIGHT RAYS: Optional volumetric light beams at 15-20% opacity if dramatic mood needed\",\n \"SURFACE TEXTURE: Add micro-detail to background (subtle noise or texture overlay at 5-8%)\",\n \"VIGNETTE: Gentle darkening at corners (15-20% opacity) to focus attention\"\n ]\n },\n {\n \"name\": \"TYPOGRAPHY POSITIONING\",\n \"text_layout\": [\n \"HEADLINE: Upper third of image, aligned left or center, large serif or bold sans-serif font\",\n \"OPTIMAL FONTS: Playfair Display, Bodoni, Montserrat Bold, Futura Heavy, or Helvetica Neue Bold\",\n \"FONT SIZE HIERARCHY: Headline (72-96pt), Subheadline (36-48pt), Description (18-24pt), CTA (24-30pt)\",\n \"SUBHEADLINE: Below headline with 20-30px spacing, lighter weight or italic variant\",\n \"DESCRIPTION: Lower third or side placement, 60% opacity for subtlety, narrow line width (40-50 characters)\",\n \"CALL-TO-ACTION: Bottom right or center-bottom, contrasting button or bold text, high-visibility color\",\n \"TEXT COLOR: White or black depending on background, with 1-2px subtle shadow or stroke for readability\",\n \"SPACING: Generous margins (80-100px from edges), balanced negative space around all text\",\n \"ALIGNMENT: Maintain consistent left/center/right alignment, use grid system\"\n ],\n \"text_effects\": [\n \"Subtle drop shadow (2-3px offset, 30-40% opacity) or outer stroke (1px) for legibility\",\n \"Text should never overlap product - always in negative space\",\n \"Gradient text overlay optional for premium feel\",\n \"Letter spacing (tracking) +50 to +100 for uppercase headlines\"\n ]\n },\n {\n \"name\": \"ADVERTISEMENT STYLE REFERENCE\",\n \"brand_inspiration\": [\n \"TECH PRODUCTS: Apple-style minimalism, clean white backgrounds, dramatic shadows, product-centric\",\n \"BEAUTY/COSMETICS: Luxury magazine editorial, soft lighting, marble textures, elegant serif fonts\",\n \"FASHION/APPAREL: High-fashion lookbook style, neutral backdrops, model integration (if applicable), sophisticated\",\n \"FOOD/BEVERAGE: Fresh and appetizing, natural wood surfaces, bright even lighting, steam or splash effects\",\n \"LIFESTYLE PRODUCTS: Aspirational living, contextual environments, warm inviting colors, lifestyle integration\"\n ],\n \"mood_keywords\": \"Premium, luxurious, aspirational, modern, sophisticated, clean, professional, Instagram-worthy, Pinterest-perfect, conversion-focused, scroll-stopping\"\n },\n {\n \"name\": \"TECHNICAL SPECIFICATIONS\",\n \"specs\": {\n \"aspect_ratio\": \"16:9 (1920x1080px) for social media, or 4:5 (1080x1350px) for Instagram feed\",\n \"resolution\": \"High resolution, 300 DPI for print-quality\",\n \"product_focus\": \"Tack-sharp, highest clarity and detail\",\n \"file_format\": \"RGB color space, sRGB profile for web\",\n \"lighting_style\": \"Studio-quality commercial photography lighting\",\n \"overall_aesthetic\": \"Premium brand campaign worthy of luxury magazines\"\n }\n },\n {\n \"name\": \"FINAL QUALITY CHECK\",\n \"checklist\": [\n \"Product is hero element and unmodified\",\n \"Visual hierarchy guides eye to product first\",\n \"Colors are harmonious and enhance product\",\n \"Lighting creates dimension and premium feel\",\n \"Background complements without competing\",\n \"Composition follows professional photography rules\",\n \"Overall look matches high-end brand standards\",\n \"Image stops scroll and invites closer inspection\",\n \"Design creates desire to purchase immediately\"\n ]\n }\n ]\n }\n },\n \n \"example_output\": {\n \"headline\": \"\",\n \"subheadline\": \"\",\n \"description\": \"\",\n \"call_to_action\": \"\",\n \"design_suggestions\": \"HERO SHOT COMPOSITION: Position the product precisely at the right-side vertical third line, 60% up from the bottom, utilizing the rule of thirds for maximum visual magnetism. The product should occupy 30% of the frame, commanding attention while allowing 70% breathing room in luxurious negative space. Layer the composition with a subtle soft-focus foreground element at the bottom left corner (perhaps a fabric corner or surface edge) at 40% opacity, the hero product in crisp middle ground, and a dreamily blurred background creating a three-dimensional depth map...\\n\\n[Continue with all sections detailed above for 400-600 words total, being specific about every visual element, measurement, color value, effect percentage, and technical detail]\"\n }\n}",
"modelId": {
"__rl": true,
"mode": "list",
"value": "models/nano-banana-pro-preview",
"cachedResultName": "models/nano-banana-pro-preview"
},
"options": {},
"resource": "image",
"inputType": "binary",
"operation": "analyze"
},
"typeVersion": 1
},
{
"id": "4a03d2cd-739a-4de3-ae51-7c41db42f596",
"name": "Combine Image & Analysis ",
"type": "n8n-nodes-base.merge",
"position": [
688,
2560
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "7f0d7e3d-37ce-4b22-be17-1d4cbd5ca554",
"name": "Prepare API Payload ",
"type": "n8n-nodes-base.code",
"position": [
896,
2560
],
"parameters": {
"jsCode": "// Collect all items from both inputs\nconst input1 = $items(\"Combine Image & Analysis \").map(i => i.json);\nconst input2 = $items(\"Combine Image & Analysis \").map(i => i.json);\n\n// Return as a single item\nreturn [\n {\n json: {\n input1: input1,\n input2: input2\n }\n }\n];\n"
},
"typeVersion": 2
},
{
"id": "6495de32-8276-4ba3-a396-a46e1dad4a8c",
"name": "Generate Enhanced Image ",
"type": "n8n-nodes-base.httpRequest",
"position": [
1136,
2560
],
"parameters": {
"url": "https://generativelanguage.googleapis.com/v1beta/models/nano-banana-pro-preview:generateContent",
"method": "POST",
"options": {},
"jsonBody": "={\n \"contents\": [\n {\n \"parts\": [\n {\n \"text\": {{ JSON.stringify($json.input1[1].content.parts[0].text) }}\n },\n {\n \"inlineData\": {\n \"mimeType\": \"image/png\",\n \"data\": \"{{ $json.input1[0].data }}\"\n }\n }\n ]\n }\n ],\n \"generationConfig\": {\n \"responseModalities\": [\"TEXT\", \"IMAGE\"]\n }\n}",
"sendBody": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"nodeCredentialType": "googlePalmApi"
},
"typeVersion": 4.2
},
{
"id": "bad17436-2c9d-42b4-90d8-a071a4838118",
"name": "Convert Base64 to Image ",
"type": "n8n-nodes-base.convertToFile",
"onError": "continueErrorOutput",
"position": [
1360,
2560
],
"parameters": {
"options": {},
"operation": "toBinary",
"sourceProperty": "candidates[0].content.parts[0].inlineData.data"
},
"typeVersion": 1.1
},
{
"id": "37ad4fee-6d5c-4c66-b242-0869327b20b1",
"name": "Convert Base64 to Image ",
"type": "n8n-nodes-base.convertToFile",
"position": [
1552,
2688
],
"parameters": {
"options": {},
"operation": "toBinary",
"sourceProperty": "candidates[0].content.parts[1].inlineData.data"
},
"typeVersion": 1.1
}
],
"connections": {
"Image to Base65": {
"main": [
[
{
"node": "Combine Image & Analysis ",
"type": "main",
"index": 0
}
]
]
},
"Telegram Trigger ": {
"main": [
[
{
"node": "Download Image File",
"type": "main",
"index": 0
}
]
]
},
"AI Design Analysis ": {
"main": [
[
{
"node": "Combine Image & Analysis ",
"type": "main",
"index": 1
}
]
]
},
"Download Image File": {
"main": [
[
{
"node": "Image to Base65",
"type": "main",
"index": 0
},
{
"node": "AI Design Analysis ",
"type": "main",
"index": 0
}
]
]
},
"Prepare API Payload ": {
"main": [
[
{
"node": "Generate Enhanced Image ",
"type": "main",
"index": 0
}
]
]
},
"Convert Base64 to Image ": {
"main": [
[
{
"node": "Send Image",
"type": "main",
"index": 0
}
],
[
{
"node": "Convert Base64 to Image ",
"type": "main",
"index": 0
}
]
]
},
"Generate Enhanced Image ": {
"main": [
[
{
"node": "Convert Base64 to Image ",
"type": "main",
"index": 0
}
]
]
},
"Combine Image & Analysis ": {
"main": [
[
{
"node": "Prepare API Payload ",
"type": "main",
"index": 0
}
]
]
},
"Convert Base64 to Image ": {
"main": [
[
{
"node": "Send Image",
"type": "main",
"index": 0
}
]
]
}
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
E-commerce businesses needing quick product ads Social media marketers without design resources Small business owners creating promotional content Product photographers seeking automated enhancements
Source: https://n8n.io/workflows/11446/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Sales Lead Qualifier. Uses telegramTrigger, googleSheets, telegram, googleGemini. Event-driven trigger; 41 nodes.
This workflow is a complete, AI-powered content engine designed to help automation experts build their personal brand on LinkedIn. It transforms a technical n8n workflow (in JSON format) into a polish
Kilua-Bot. Uses telegramTrigger, telegram, googleGemini, httpRequest. Event-driven trigger; 17 nodes.
This workflow allows Telegram users to submit a domain for quick threat intelligence analysis. It queries VirusTotal, AbuseCH URLHaus, and AbuseCH ThreatFox, then uses Gemini AI to generate a formatte
This workflow is perfect for: E-commerce sellers needing quick product videos Social media marketers creating content at scale Small business owners without video editing skills Product photographers