{
  "name": "Marketing Image Generator",
  "nodes": [
    {
      "parameters": {
        "promptType": "define",
        "text": "=Product Name:{{ $('Split').item.json.productName }}\nTagline: {{ $('Split').item.json.tagline }}\nBrand: {{ $('Get row(s) in sheet').all()[0].json.col_2 }}\nTone: {{ $('Get row(s) in sheet').all()[1].json.col_2 }}\nCategory: {{ $('Split').item.json.category }}\nBenefit: {{ $('Split').item.json.benefit }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "=# You are a premium product photographer and stylist.\n\n## Your Task\nSuggest creative visual styling elements for 5 product launch assets — each for a different channel.  \nBased on the product details provided, adapt your creative direction to match the brand's category, tone, and benefit.\n\n## Input Context: See User Input\n\n## Requirements\nEach asset must:\n- Feel part of the same brand campaign  \n- Use varied styling (not repetitive)  \n- Be visually differentiated based on its platform and purpose  \n- Align with the product category and brand tone specified above\n\n## Output Format\nReturn a JSON object with the following structure:\n\n### For each asset, vary the:\n- backgroundTone → must be visually attractive and aligned with the product category and brand tone\n- surfaceType → creative and supportive of the product's aesthetic (e.g., luxurious for cosmetics, natural for wellness, sleek for tech)\n- accentProp → intentional and category-appropriate (e.g., flowers for beauty, ingredients for food, lifestyle elements for fashion)\n- lighting → varies by mood or asset format  \n- cameraAngle → changes perspective and storytelling  \n- overlayText → a short yet attractive copy that reflects the brand tone and category. Could be a CTA, the specific product benefit, or a product highlight. Avoid using the tagline directly. Match the language style to the brand personality.\n\n## Visual Direction Guidelines by Category\nAnalyze the product category and adapt styling elements accordingly:\n\n**For Beauty/Cosmetics**: Use luxurious textures like marble, silk, glass, mirrors, flowers, crystals, or metallic accents\n**For Food/Beverage**: Use organic materials like wood, ceramics, fresh ingredients, kitchen elements, or natural textures\n**For Tech/Electronics**: Use modern surfaces like metal, glass, geometric shapes, minimal backgrounds, or futuristic elements\n**For Fashion/Accessories**: Use fabrics, lifestyle props, elegant surfaces, or contextual styling elements\n**For Wellness/Health**: Use natural materials like stone, plants, water elements, or calming textures\n**For Home/Lifestyle**: Use cozy textures, living spaces, decorative elements, or atmospheric settings\n\nEnsure each scene feels intentional and elevated for the specific product category.\nDo not reuse the same exact prop, background, or layout across assets.\n\nOnly respond with the structured JSON output.\n\n---\n\n## Asset Guidelines\n\n### 1. Instagram Post  \n- Purpose: Feed-worthy hero image for social media  \n- Visual Style: Balanced composition with strong product presence. Props should feel organic and brand-aligned. Adapt boldness to category (luxury for beauty, energetic for sports, minimal for tech).\n\n### 2. Instagram Story  \n- Purpose: Vertical (9:16) mobile-first visual  \n- Visual Style: Intimate details and textures relevant to the product. Close-ups that highlight quality and craftsmanship appropriate to the category.\n\n### 3. Website Banner  \n- Purpose: Wide header for homepage or hero section  \n- Visual Style: Spacious, professional layout. Establish credibility and brand positioning. Adapt formality to brand tone.\n\n### 4. Ad Creative  \n- Purpose: High-impact visual for paid ads or carousels  \n- Visual Style: Bold and attention-grabbing while maintaining category-appropriate premium feel. Use contrast and visual tension suited to the product type.\n\n### 5. Testimonial Graphic  \n- Purpose: Visual support for a customer quote or review  \n- Visual Style: Emotionally resonant with subtle product placement. Adapt warmth and style to category (sophisticated for luxury, friendly for everyday products)."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        580,
        -260
      ],
      "id": "e8e323f4-24c1-40ca-8526-9990dbcf282e",
      "name": "AI Agent",
      "executeOnce": true
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        600,
        -40
      ],
      "id": "24e58354-74da-4f35-936d-6dccadd6b1ec",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "80b8DOj8REc2MMqi",
          "name": "OpenAi account 9"
        }
      }
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\n  \"assets\": [\n    {\n      \"assetType\": \"Instagram Post\",\n      \"backgroundTone\": \"earth-toned gradient with warm highlights\",\n      \"surfaceType\": \"organic cotton cloth\",\n      \"accentProp\": \"brass scoop with protein powder trail\",\n      \"lighting\": \"soft angled daylight from the left\",\n      \"cameraAngle\": \"slight top-down perspective\",\n      \"overlayText\": \"Plant power, perfected.\"\n    },\n    {\n      \"assetType\": \"Instagram Story\",\n      \"backgroundTone\": \"light oat with subtle shadows\",\n      \"surfaceType\": \"raw ceramic plate\",\n      \"accentProp\": \"fresh mint leaves near scoop\",\n      \"lighting\": \"diffused top-light with warm edges\",\n      \"cameraAngle\": \"tight overhead close-up\",\n      \"overlayText\": \"Clean protein. Real results.\"\n    },\n    {\n      \"assetType\": \"Website Banner\",\n      \"backgroundTone\": \"neutral beige with stone texture\",\n      \"surfaceType\": \"smooth matte wood\",\n      \"accentProp\": \"a minimalist glass jar of powder\",\n      \"lighting\": \"natural light sweeping from side\",\n      \"cameraAngle\": \"wide low-angle side view\",\n      \"overlayText\": \"Fuel your body, naturally.\"\n    },\n    {\n      \"assetType\": \"Ad Creative\",\n      \"backgroundTone\": \"deep forest green with subtle grain\",\n      \"surfaceType\": \"raw slate slab\",\n      \"accentProp\": \"burst of cacao and vanilla pods\",\n      \"lighting\": \"high-contrast studio light with edge rim\",\n      \"cameraAngle\": \"dynamic angle from above\",\n      \"overlayText\": \"Get 10% Off – Today Only\"\n    },\n    {\n      \"assetType\": \"Testimonial Graphic\",\n      \"backgroundTone\": \"warm almond linen\",\n      \"surfaceType\": \"light concrete texture\",\n      \"accentProp\": \"single flax stem\",\n      \"lighting\": \"gentle window light from the side\",\n      \"cameraAngle\": \"front-facing portrait angle\",\n      \"overlayText\": \"Finally, a protein I trust daily.\"\n    }\n  ]\n}\n"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        720,
        -40
      ],
      "id": "c4c2e494-5376-4966-912a-3c0db5c4608d",
      "name": "Structured Output Parser"
    },
    {
      "parameters": {
        "jsCode": "return [\n  {\n    json: $json,\n    binary: {\n      image: {\n        ...$node[\"Get Image\"].binary.data,\n        mimeType: 'image/png'  // or 'image/jpeg' depending on your file\n      }\n    }\n  }\n];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        940,
        -260
      ],
      "id": "72f0aad1-af4b-405d-b41d-04b517a510d6",
      "name": "Set"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.output.assets[0].assetType }}",
                    "rightValue": "Instagram Post",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "01503b6a-d8b4-44b8-b978-c3541f3bd8fd"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Instagram Post"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "23bfee4f-1007-4ccb-9262-442e6db930c2",
                    "leftValue": "={{ $json.output.assets[1].assetType }}",
                    "rightValue": "Instagram Story",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Instagram Story"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "06655803-5b67-457d-9575-eee629085a3b",
                    "leftValue": "={{ $json.output.assets[2].assetType }}",
                    "rightValue": "Website Banner",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Website Banner"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "95a3561d-c9d0-4ae9-8f12-682c6a59acd9",
                    "leftValue": "={{ $json.output.assets[3].assetType }}",
                    "rightValue": "Ad Creative",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Ad Creative"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "a2602a74-5b5a-452a-9581-fa744629034c",
                    "leftValue": "={{ $json.output.assets[4].assetType }}",
                    "rightValue": "Testimonial Graphic",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Testimonial Graphic"
            }
          ]
        },
        "options": {
          "allMatchingOutputs": true
        }
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        1160,
        -300
      ],
      "id": "0c43a4e3-6a82-45e6-8222-4454378bb60a",
      "name": "Switch"
    },
    {
      "parameters": {
        "method": "=POST",
        "url": "https://api.openai.com/v1/images/edits",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_YOUR_API_KEY"
            }
          ]
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-image-1"
            },
            {
              "name": "prompt",
              "value": "=Create a photorealistic square (1:1) visual for the Instagram Post representing the product from {{ $('Get row(s) in sheet').all()[0].json.col_2 }}.  \n\nThis will serve as the lead image for the launch campaign — it should feel confident, refined, and instantly recognizable. The layout must be clean and focused, with the product placed front and center to establish a strong visual identity for the rest of the assets.\n\nThe product image is provided and must remain untouched. Use it within a carefully styled, premium scene that reflects the {{ $('Split').first().json.category }} category.\n\nUse a background in line with {{ $('AI Agent').first().json.output.assets[0].backgroundTone }} — adapting materials and textures to the product category and brand positioning. Position the product on a {{ $('AI Agent').first().json.output.assets[0].surfaceType }} that enhances the product's premium quality and category relevance.\n\nAdd a supporting prop like a {{ $('AI Agent').first().json.output.assets[0].accentProp }} to enrich the scene — it should be tasteful, category-appropriate, and on-brand, never distracting.\n\nIlluminate the scene using {{ $('AI Agent').first().json.output.assets[0].lighting }} to give the image a sense of shape and clarity. The camera should capture the product from a {{ $('AI Agent').first().json.output.assets[0].cameraAngle }} to create a sense of depth and dynamic presentation.\n\nFollow the defined brand system:\n- Brand tone: {{ $('Get row(s) in sheet').all()[1].json.col_2 }}\n- Color direction: {{ $('Get row(s) in sheet').all()[2].json.col_2 }}\n- Typography guidance (for reference only): {{ $('Get row(s) in sheet').all()[6].json.col_2 }}\n- Placement style: {{ $('Get row(s) in sheet').all()[5].json.col_2 }}\n- Composition rules: {{ $('Get row(s) in sheet').all()[7].json.col_2 }}\n\nIf applicable, add overlay text: \"{{ $('AI Agent').first().json.output.assets[0].overlayText }}\". Make sure it's well-integrated, stylistically consistent, and does not overpower the product.\n\nThe result should be a crisp, emotionally aligned hero image suitable for both high-end Instagram feeds and premium marketing campaigns, tailored to the {{ $('Split').first().json.category }} market."
            },
            {
              "name": "output_format",
              "value": "png"
            },
            {
              "parameterType": "formBinaryData",
              "name": "image",
              "inputDataFieldName": "image"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1380,
        -660
      ],
      "id": "6f459eaa-3ad8-471a-9a2c-47baae994bbc",
      "name": "Instagram Post"
    },
    {
      "parameters": {
        "operation": "toBinary",
        "sourceProperty": "data[0].b64_json",
        "options": {}
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        1600,
        -660
      ],
      "id": "e8a690bd-de51-43b0-822a-2420977c35d7",
      "name": "Convert to File"
    },
    {
      "parameters": {
        "operation": "toBinary",
        "sourceProperty": "data[0].b64_json",
        "options": {}
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        1600,
        -460
      ],
      "id": "9ba396e0-45c6-4c8c-843b-eb540d170573",
      "name": "Convert to File1"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.openai.com/v1/images/edits",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_YOUR_API_KEY"
            }
          ]
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-image-1"
            },
            {
              "name": "prompt",
              "value": "=Create a vertical 9:16 photorealistic Instagram Story visual for the product {{ $('Split').first().json.productName }} by {{ $('Get row(s) in sheet').all()[0].json.col_2 }}.\n\nThis is a mobile-optimized asset — it should feel personal, immersive, and naturally scrollable. The scene should be more intimate and tactile than the main Instagram post, with textures and styling appropriate for the {{ $('Split').first().json.category }} category, featuring an intentional vertical flow.  \n\nThe product image is provided and must remain unedited. Incorporate it into a clean, vertical layout designed for mobile viewing.\n\nUse a background matching {{ $json.output.assets[1].backgroundTone }} that supports upward visual movement and reflects the product's category positioning. Position the product on a surface like {{ $json.output.assets[1].surfaceType }} that complements the vertical format with category-appropriate elegance.\n\nAdd a subtle, vertically appropriate prop such as a {{ $json.output.assets[1].accentProp }} to frame or guide the viewer's eye. It should feel natural, category-relevant, and support the mobile-first aesthetic.\n\nUse {{ $json.output.assets[1].lighting }} to keep the product well-lit and visually sharp on smartphones. Capture it from a {{ $json.output.assets[1].cameraAngle }} that works well in a tall, immersive layout.\n\nFollow the defined brand system:\n- Brand tone: {{ $('Get row(s) in sheet').all()[1].json.col_2 }}\n- Color direction: {{ $('Get row(s) in sheet').all()[2].json.col_2 }}\n- Typography guidance (for reference only): {{ $('Get row(s) in sheet').all()[6].json.col_2 }}\n- Placement style: {{ $('Get row(s) in sheet').all()[5].json.col_2 }}\n- Composition rules: {{ $('Get row(s) in sheet').all()[7].json.col_2 }}\n\nInclude optional overlay text: \"{{ $json.output.assets[1].overlayText }}\". Make sure it aligns with the layout and enhances the storytelling without overpowering the image.\n\nThe final result should feel intimate, premium, and crafted for fast, elegant viewing on Instagram Stories, tailored to connect with the {{ $('Split').first().json.category }} audience."
            },
            {
              "name": "output_format",
              "value": "png"
            },
            {
              "parameterType": "formBinaryData",
              "name": "image",
              "inputDataFieldName": "image"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1380,
        -460
      ],
      "id": "bc0f51ae-ad23-4890-bd77-4b9406188ef0",
      "name": "Instagram Story"
    },
    {
      "parameters": {
        "operation": "toBinary",
        "sourceProperty": "data[0].b64_json",
        "options": {}
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        1600,
        -260
      ],
      "id": "5af53e13-c93a-4e58-8682-42d16928304f",
      "name": "Convert to File2"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.openai.com/v1/images/edits",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_YOUR_API_KEY"
            }
          ]
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-image-1"
            },
            {
              "name": "prompt",
              "value": "=Create a horizontal 16:9 photorealistic Website Banner visual for the product {{ $('Split').first().json.productName }} from {{ $('Get row(s) in sheet').all()[0].json.col_2 }}.\n\nThis visual is intended for the homepage hero section. It should feel open, minimal, and carefully composed, with an off-center layout that provides visual breathing space. Compared to social assets, it should have a calmer, more ambient tone suited for desktop viewing and appropriate for the {{ $('Split').first().json.category }} market.  \n\nThe product image is supplied and must remain unchanged. Incorporate it into a clean layout designed specifically for large web screens, emphasizing clarity and space.\n\nUse a background based on {{ $json.output.assets[2].backgroundTone }} that reflects the product category and works well in widescreen formats. Position the product on a {{ $json.output.assets[2].surfaceType }} that aligns visually left or right within the frame.\n\nAdd one accent prop, such as a {{ $json.output.assets[2].accentProp }}, that adds gentle visual interest without drawing too much attention. The layout should feel breathable and uncluttered while maintaining category-appropriate sophistication.\n\nApply {{ $json.output.assets[2].lighting }} to add soft dimensionality, and choose a {{ $json.output.assets[2].cameraAngle }} that supports side placement and allows for external text or overlays to be added outside the image.\n\nFollow the defined brand system:\n- Brand tone: {{ $('Get row(s) in sheet').all()[1].json.col_2 }}\n- Color direction: {{ $('Get row(s) in sheet').all()[2].json.col_2 }}\n- Typography guidance (for reference only): {{ $('Get row(s) in sheet').all()[6].json.col_2 }}\n- Placement style: {{ $('Get row(s) in sheet').all()[5].json.col_2 }}\n- Composition rules: {{ $('Get row(s) in sheet').all()[7].json.col_2 }}\n\nOptionally include overlay text: \"{{ $json.output.assets[2].overlayText }}\". It should be easy to read, visually balanced, and tastefully integrated. Do not cut off any part of the text but ensure that text is completely displayed on the image.\n\nThe final visual should feel modern, sophisticated, and designed to elevate the homepage of a premium {{ $('Split').first().json.category }} brand, establishing trust and credibility with desktop visitors."
            },
            {
              "name": "output_format",
              "value": "png"
            },
            {
              "parameterType": "formBinaryData",
              "name": "image",
              "inputDataFieldName": "image"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1380,
        -260
      ],
      "id": "92457fd1-66e6-47b9-b0ff-57194740791a",
      "name": "Website Banner"
    },
    {
      "parameters": {
        "operation": "toBinary",
        "sourceProperty": "data[0].b64_json",
        "options": {}
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        1600,
        -60
      ],
      "id": "fbd82e5e-78e6-46ea-9ce4-bcd6e59d53a5",
      "name": "Convert to File3"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.openai.com/v1/images/edits",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_YOUR_API_KEY"
            }
          ]
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-image-1"
            },
            {
              "name": "prompt",
              "value": "=Create a square 1:1 photorealistic Ad Creative visual for the product {{ $('Split').first().json.productName }} from {{ $('Get row(s) in sheet').all()[0].json.col_2 }}.\n\nThis visual is intended for paid social campaigns. It should stand out in the feed with bold energy appropriate for the {{ $('Split').first().json.category }} category — featuring dramatic lighting, confident framing, and a strong visual hierarchy that sets it apart from standard brand posts.  \n\nThe product image is provided and should remain unedited. Place it in a bold, high-impact layout tailored for advertising performance in the {{ $('Split').first().json.category }} market.\n\nUse a background aligned with {{ $json.output.assets[3].backgroundTone }} that grabs attention instantly while remaining category-appropriate. Set the product on a {{ $json.output.assets[3].surfaceType }} that enhances the contrast and energy without overpowering the scene.\n\nIncorporate a striking prop like a {{ $json.output.assets[3].accentProp }} to heighten the composition. The overall setup should feel bold, energetic, and purposefully constructed for your product category.\n\nUse {{ $json.output.assets[3].lighting }} to add strong highlights and shadow depth. Capture the image from a {{ $json.output.assets[3].cameraAngle }} that enhances visual intensity and structure.\n\nFollow the defined brand system:\n- Brand tone: {{ $('Get row(s) in sheet').all()[1].json.col_2 }}\n- Color direction: {{ $('Get row(s) in sheet').all()[2].json.col_2 }}\n- Typography guidance (for reference only): {{ $('Get row(s) in sheet').all()[6].json.col_2 }}\n- Placement style: {{ $('Get row(s) in sheet').all()[5].json.col_2 }}\n- Composition rules: {{ $('Get row(s) in sheet').all()[7].json.col_2 }}\n\nYou may include overlay text: \"{{ $json.output.assets[3].overlayText }}\". It should be bold yet refined, and positioned in a way that supports the visual flow.\n\nThe result should be attention-grabbing, premium, and ready for high-performing ads in the {{ $('Split').first().json.category }} space — while remaining true to the brand's visual identity."
            },
            {
              "name": "output_format",
              "value": "png"
            },
            {
              "parameterType": "formBinaryData",
              "name": "image",
              "inputDataFieldName": "image"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1380,
        -60
      ],
      "id": "29bc4596-3ab9-40e5-b6ca-ed30c4a9c563",
      "name": "Ad Creative"
    },
    {
      "parameters": {
        "operation": "toBinary",
        "sourceProperty": "data[0].b64_json",
        "options": {}
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        1600,
        140
      ],
      "id": "eed49ead-3ef3-4dc0-a073-5ca840ac4b85",
      "name": "Convert to File4"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.openai.com/v1/images/edits",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_YOUR_API_KEY"
            }
          ]
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-image-1"
            },
            {
              "name": "prompt",
              "value": "=Create a square 1:1 photorealistic Testimonial Graphic visual for the product {{ $('Split').first().json.productName }} from {{ $('Get row(s) in sheet').all()[0].json.col_2 }}.\n\nThis image is designed to accompany a customer quote or review. It should feel soft, sincere, and emotionally warm for the {{ $('Split').first().json.category }} category — a contrast to the more attention-grabbing campaign visuals. The design should be minimal and supportive, drawing quiet attention to the product.  \n\nThe product image is supplied and must remain unmodified. Integrate it into a calm and comforting composition suitable for a testimonial setting in the {{ $('Split').first().json.category }} market.\n\nUse a background based on {{ $json.output.assets[4].backgroundTone }} that feels muted and subtle while reflecting the category's emotional tone. Gently place the product on a {{ $json.output.assets[4].surfaceType }} that conveys warmth and approachability appropriate for your product type.\n\nInclude a thoughtful, emotional prop such as a {{ $json.output.assets[4].accentProp }} that enhances the atmosphere without overwhelming it. But do not use the same text as the overlay text. Keep the styling restrained and heartfelt in a way that resonates with {{ $('Split').first().json.category }} customers.\n\nUse {{ $json.output.assets[4].lighting }} to create a soft, welcoming light environment. Capture the visual from a {{ $json.output.assets[4].cameraAngle }} that feels grounded and trustworthy.\n\nFollow the defined brand system:\n- Brand tone: {{ $('Get row(s) in sheet').all()[1].json.col_2 }}\n- Color direction: {{ $('Get row(s) in sheet').all()[2].json.col_2 }}\n- Typography guidance (for reference only): {{ $('Get row(s) in sheet').all()[6].json.col_2 }}\n- Placement style: {{ $('Get row(s) in sheet').all()[5].json.col_2 }}\n- Composition rules: {{ $('Get row(s) in sheet').all()[7].json.col_2 }}\n\nInclude overlay text: \"{{ $json.output.assets[4].overlayText }}\". It should be calm, clear, and harmoniously integrated into the layout and written within quotation marks to look like a real customer testimonial. \n\nThis graphic should gently reinforce a testimonial with quiet confidence — minimal, human, and emotionally aligned with the {{ $('Split').first().json.category }} brand experience."
            },
            {
              "name": "output_format",
              "value": "png"
            },
            {
              "parameterType": "formBinaryData",
              "name": "image",
              "inputDataFieldName": "image"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1380,
        140
      ],
      "id": "b8811c68-90b7-42fb-b16f-2e87528c8bca",
      "name": "Testimonial Graphic"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1FTkXOTUY8F-AUWx1zUnRCKoPGWPuMRKnjaxe5UuYPuU",
          "mode": "list",
          "cachedResultName": "v3.4 Marketing Image Generator",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1FTkXOTUY8F-AUWx1zUnRCKoPGWPuMRKnjaxe5UuYPuU/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 740956331,
          "mode": "list",
          "cachedResultName": "Brand Settings",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1FTkXOTUY8F-AUWx1zUnRCKoPGWPuMRKnjaxe5UuYPuU/edit#gid=740956331"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        360,
        -260
      ],
      "id": "73c720bf-52ee-41fa-9f89-edc094d23f16",
      "name": "Get row(s) in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "uJs2j7wVby6KZmho",
          "name": "Google Sheets account 9"
        }
      }
    },
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        -300,
        -260
      ],
      "id": "ca278574-dcf1-4fea-91d8-785bed9c3c8a",
      "name": "Telegram Trigger",
      "webhookId": "87a16ef2-a847-4c3e-be76-96f08f8bc40a",
      "credentials": {
        "telegramApi": {
          "id": "W71JhaluJR5IFzk7",
          "name": "Telegram account 29"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const text = $('Telegram Trigger').first().json.message.caption;\nconst parts = text.split(';').map(part => part.trim());\n\nreturn {\n  productName: parts[0],\n  tagline: parts[1],\n  category: parts[2],\n  benefit: parts[3]\n};"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        140,
        -260
      ],
      "id": "c3938e95-093d-4ae8-a00f-e7db39124bdf",
      "name": "Split"
    },
    {
      "parameters": {
        "resource": "file",
        "fileId": "={{ $json.message.photo[3].file_id }}"
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -80,
        -260
      ],
      "id": "9c449d10-cf75-4f37-a243-cb157120ad53",
      "name": "Get Image",
      "webhookId": "67494f88-8b71-4204-a5f2-8776cef65c4d",
      "credentials": {
        "telegramApi": {
          "id": "W71JhaluJR5IFzk7",
          "name": "Telegram account 29"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://www.filestackapi.com/api/store/S3?key=AhTgLagciQByzXpFGRI0Az",
        "sendBody": true,
        "contentType": "binaryData",
        "inputDataFieldName": "data",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1820,
        -260
      ],
      "id": "4fd37cbb-565c-49b9-8a07-b5e1f5fd608d",
      "name": "Upload Image 2"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1FTkXOTUY8F-AUWx1zUnRCKoPGWPuMRKnjaxe5UuYPuU",
          "mode": "list",
          "cachedResultName": "v3.4 Marketing Image Generator",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1FTkXOTUY8F-AUWx1zUnRCKoPGWPuMRKnjaxe5UuYPuU/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 195353624,
          "mode": "list",
          "cachedResultName": "Finished Images",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1hz2cuE0rP1gSB7-REzCQeIPjoBTNhHhJ2oebOKCZW9o/edit#gid=195353624"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Brand Name": "={{ $('Get row(s) in sheet').all()[0].json.col_2 }}",
            "Product Name": "={{ $('Split').first().json.productName }}",
            "Media Type": "={{ $('AI Agent').first().json.output.assets[2].assetType }}",
            "Background Tone": "={{ $('AI Agent').first().json.output.assets[2].backgroundTone }}",
            "Surface Type": "={{ $('AI Agent').first().json.output.assets[2].surfaceType }}",
            "Accent Prop": "={{ $('AI Agent').first().json.output.assets[2].accentProp }}",
            "Lighting": "={{ $('AI Agent').first().json.output.assets[2].lighting }}",
            "Camera Angle": "={{ $('AI Agent').first().json.output.assets[2].cameraAngle }}",
            "Overlay Text": "={{ $('AI Agent').first().json.output.assets[2].overlayText }}",
            "Date and Time": "={{$now}}",
            "Image Link": "={{ $json.url }}"
          },
          "matchingColumns": [
            "s"
          ],
          "schema": [
            {
              "id": "Date and Time",
              "displayName": "Date and Time",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Brand Name",
              "displayName": "Brand Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Product Name",
              "displayName": "Product Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Media Type",
              "displayName": "Media Type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Background Tone",
              "displayName": "Background Tone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Surface Type",
              "displayName": "Surface Type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Accent Prop",
              "displayName": "Accent Prop",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Lighting",
              "displayName": "Lighting",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Camera Angle",
              "displayName": "Camera Angle",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Overlay Text",
              "displayName": "Overlay Text",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Image Link",
              "displayName": "Image Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Image Display",
              "displayName": "Image Display",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        2040,
        -260
      ],
      "id": "d28dedf2-c943-403e-a761-74054b244f1a",
      "name": "Update sheet2",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "uJs2j7wVby6KZmho",
          "name": "Google Sheets account 9"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1FTkXOTUY8F-AUWx1zUnRCKoPGWPuMRKnjaxe5UuYPuU",
          "mode": "list",
          "cachedResultName": "v3.4 Marketing Image Generator",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1FTkXOTUY8F-AUWx1zUnRCKoPGWPuMRKnjaxe5UuYPuU/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 195353624,
          "mode": "list",
          "cachedResultName": "Finished Images",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1hz2cuE0rP1gSB7-REzCQeIPjoBTNhHhJ2oebOKCZW9o/edit#gid=195353624"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Brand Name": "={{ $('Get row(s) in sheet').all()[0].json.col_2 }}",
            "Product Name": "={{ $('Split').first().json.productName }}",
            "Media Type": "={{ $('AI Agent').first().json.output.assets[3].assetType }}",
            "Background Tone": "={{ $('AI Agent').first().json.output.assets[3].backgroundTone }}",
            "Surface Type": "={{ $('AI Agent').first().json.output.assets[3].surfaceType }}",
            "Accent Prop": "={{ $('AI Agent').first().json.output.assets[3].accentProp }}",
            "Lighting": "={{ $('AI Agent').first().json.output.assets[3].lighting }}",
            "Camera Angle": "={{ $('AI Agent').first().json.output.assets[3].cameraAngle }}",
            "Overlay Text": "={{ $('AI Agent').first().json.output.assets[3].overlayText }}",
            "Date and Time": "={{$now}}",
            "Image Link": "={{ $json.url }}"
          },
          "matchingColumns": [
            "s"
          ],
          "schema": [
            {
              "id": "Date and Time",
              "displayName": "Date and Time",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Brand Name",
              "displayName": "Brand Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Product Name",
              "displayName": "Product Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Media Type",
              "displayName": "Media Type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Background Tone",
              "displayName": "Background Tone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Surface Type",
              "displayName": "Surface Type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Accent Prop",
              "displayName": "Accent Prop",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Lighting",
              "displayName": "Lighting",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Camera Angle",
              "displayName": "Camera Angle",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Overlay Text",
              "displayName": "Overlay Text",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Image Link",
              "displayName": "Image Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Image Display",
              "displayName": "Image Display",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        2040,
        -60
      ],
      "id": "6cb947b1-871f-410c-82cb-63280389baa1",
      "name": "Update sheet3",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "uJs2j7wVby6KZmho",
          "name": "Google Sheets account 9"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1FTkXOTUY8F-AUWx1zUnRCKoPGWPuMRKnjaxe5UuYPuU",
          "mode": "list",
          "cachedResultName": "v3.4 Marketing Image Generator",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1FTkXOTUY8F-AUWx1zUnRCKoPGWPuMRKnjaxe5UuYPuU/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 195353624,
          "mode": "list",
          "cachedResultName": "Finished Images",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1hz2cuE0rP1gSB7-REzCQeIPjoBTNhHhJ2oebOKCZW9o/edit#gid=195353624"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Brand Name": "={{ $('Get row(s) in sheet').all()[0].json.col_2 }}",
            "Product Name": "={{ $('Split').first().json.productName }}",
            "Media Type": "={{ $('AI Agent').first().json.output.assets[4].assetType }}",
            "Background Tone": "={{ $('AI Agent').first().json.output.assets[4].backgroundTone }}",
            "Surface Type": "={{ $('AI Agent').first().json.output.assets[4].surfaceType }}",
            "Accent Prop": "={{ $('AI Agent').first().json.output.assets[4].accentProp }}",
            "Lighting": "={{ $('AI Agent').first().json.output.assets[4].lighting }}",
            "Camera Angle": "={{ $('AI Agent').first().json.output.assets[4].cameraAngle }}",
            "Overlay Text": "={{ $('AI Agent').first().json.output.assets[4].overlayText }}",
            "Date and Time": "={{$now}}",
            "Image Link": "={{ $json.url }}"
          },
          "matchingColumns": [
            "s"
          ],
          "schema": [
            {
              "id": "Date and Time",
              "displayName": "Date and Time",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Brand Name",
              "displayName": "Brand Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Product Name",
              "displayName": "Product Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Media Type",
              "displayName": "Media Type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Background Tone",
              "displayName": "Background Tone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Surface Type",
              "displayName": "Surface Type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Accent Prop",
              "displayName": "Accent Prop",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Lighting",
              "displayName": "Lighting",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Camera Angle",
              "displayName": "Camera Angle",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Overlay Text",
              "displayName": "Overlay Text",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Image Link",
              "displayName": "Image Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Image Display",
              "displayName": "Image Display",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        2040,
        140
      ],
      "id": "3a7e4560-c356-47b5-a877-48c37f5967cc",
      "name": "Update sheet4",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "uJs2j7wVby6KZmho",
          "name": "Google Sheets account 9"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://www.filestackapi.com/api/store/S3?key=AhTgLagciQByzXpFGRI0Az",
        "sendBody": true,
        "contentType": "binaryData",
        "inputDataFieldName": "data",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1820,
        -460
      ],
      "id": "c909fff2-0344-4645-af08-68ff4214be51",
      "name": "Upload Image1"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://www.filestackapi.com/api/store/S3?key=AhTgLagciQByzXpFGRI0Az",
        "sendBody": true,
        "contentType": "binaryData",
        "inputDataFieldName": "data",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1820,
        140
      ],
      "id": "bd29e0b3-1cc1-4c9d-90e5-ae2a54db7575",
      "name": "Upload Image4"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://www.filestackapi.com/api/store/S3?key=AhTgLagciQByzXpFGRI0Az",
        "sendBody": true,
        "contentType": "binaryData",
        "inputDataFieldName": "data",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1820,
        -60
      ],
      "id": "870fbefe-fa8a-4f1a-9e5c-463c90b27c8f",
      "name": "Upload Image3"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1FTkXOTUY8F-AUWx1zUnRCKoPGWPuMRKnjaxe5UuYPuU",
          "mode": "list",
          "cachedResultName": "v3.4 Marketing Image Generator",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1FTkXOTUY8F-AUWx1zUnRCKoPGWPuMRKnjaxe5UuYPuU/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 195353624,
          "mode": "list",
          "cachedResultName": "Finished Images",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1hz2cuE0rP1gSB7-REzCQeIPjoBTNhHhJ2oebOKCZW9o/edit#gid=195353624"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Brand Name": "={{ $('Get row(s) in sheet').all()[0].json.col_2 }}",
            "Product Name": "={{ $('Split').first().json.productName }}",
            "Media Type": "={{ $('AI Agent').first().json.output.assets[1].assetType }}",
            "Background Tone": "={{ $('AI Agent').first().json.output.assets[1].backgroundTone }}",
            "Surface Type": "={{ $('AI Agent').first().json.output.assets[1].surfaceType }}",
            "Accent Prop": "={{ $('AI Agent').first().json.output.assets[1].accentProp }}",
            "Lighting": "={{ $('AI Agent').first().json.output.assets[1].lighting }}",
            "Camera Angle": "={{ $('AI Agent').first().json.output.assets[1].cameraAngle }}",
            "Overlay Text": "={{ $('AI Agent').first().json.output.assets[1].overlayText }}",
            "Date and Time": "={{$now}}",
            "Image Link": "={{ $json.url }}"
          },
          "matchingColumns": [
            "s"
          ],
          "schema": [
            {
              "id": "Date and Time",
              "displayName": "Date and Time",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Brand Name",
              "displayName": "Brand Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Product Name",
              "displayName": "Product Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Media Type",
              "displayName": "Media Type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Background Tone",
              "displayName": "Background Tone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Surface Type",
              "displayName": "Surface Type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Accent Prop",
              "displayName": "Accent Prop",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Lighting",
              "displayName": "Lighting",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Camera Angle",
              "displayName": "Camera Angle",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Overlay Text",
              "displayName": "Overlay Text",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Image Link",
              "displayName": "Image Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Image Display",
              "displayName": "Image Display",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        2040,
        -460
      ],
      "id": "4ed79bde-c7c6-472f-9af0-d06fcd7bda93",
      "name": "Update sheet1",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "uJs2j7wVby6KZmho",
          "name": "Google Sheets account 9"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://www.filestackapi.com/api/store/S3?key=AhTgLagciQByzXpFGRI0Az",
        "sendBody": true,
        "contentType": "binaryData",
        "inputDataFieldName": "data",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1820,
        -660
      ],
      "id": "9cf01b68-f0de-463e-b9f3-a85b2beedf2c",
      "name": "Upload Image"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1FTkXOTUY8F-AUWx1zUnRCKoPGWPuMRKnjaxe5UuYPuU",
          "mode": "list",
          "cachedResultName": "v3.4 Marketing Image Generator",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1FTkXOTUY8F-AUWx1zUnRCKoPGWPuMRKnjaxe5UuYPuU/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 195353624,
          "mode": "list",
          "cachedResultName": "Finished Images",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1FTkXOTUY8F-AUWx1zUnRCKoPGWPuMRKnjaxe5UuYPuU/edit#gid=195353624"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Brand Name": "={{ $('Get row(s) in sheet').all()[0].json.col_2 }}",
            "Product Name": "={{ $('Split').first().json.productName }}",
            "Media Type": "={{ $('AI Agent').first().json.output.assets[0].assetType }}",
            "Background Tone": "={{ $('AI Agent').first().json.output.assets[0].backgroundTone }}",
            "Surface Type": "={{ $('AI Agent').first().json.output.assets[0].surfaceType }}",
            "Accent Prop": "={{ $('AI Agent').first().json.output.assets[0].accentProp }}",
            "Lighting": "={{ $('AI Agent').first().json.output.assets[0].lighting }}",
            "Camera Angle": "={{ $('AI Agent').first().json.output.assets[0].cameraAngle }}",
            "Overlay Text": "={{ $('AI Agent').first().json.output.assets[0].overlayText }}",
            "Date and Time": "={{$now}}",
            "Image Link": "={{ $json.url }}"
          },
          "matchingColumns": [
            "s"
          ],
          "schema": [
            {
              "id": "Date and Time",
              "displayName": "Date and Time",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Brand Name",
              "displayName": "Brand Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Product Name",
              "displayName": "Product Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Media Type",
              "displayName": "Media Type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Background Tone",
              "displayName": "Background Tone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Surface Type",
              "displayName": "Surface Type",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Accent Prop",
              "displayName": "Accent Prop",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Lighting",
              "displayName": "Lighting",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Camera Angle",
              "displayName": "Camera Angle",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Overlay Text",
              "displayName": "Overlay Text",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Image Link",
              "displayName": "Image Link",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "Image Display",
              "displayName": "Image Display",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.6,
      "position": [
        2040,
        -660
      ],
      "id": "d7201d8c-4e29-41d5-adb6-f0c99dfeacd7",
      "name": "Update sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "uJs2j7wVby6KZmho",
          "name": "Google Sheets account 9"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendPhoto",
        "chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
        "file": "={{ $json['Image Link'] }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        2260,
        -660
      ],
      "id": "90e77727-f9d4-45f0-9262-d73c8be10b79",
      "name": "Send a photo message",
      "webhookId": "c9234e94-94e4-4e72-8b1c-6fcbdfa11f6f",
      "credentials": {
        "telegramApi": {
          "id": "W71JhaluJR5IFzk7",
          "name": "Telegram account 29"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendPhoto",
        "chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
        "file": "={{ $json['Image Link'] }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        2260,
        -460
      ],
      "id": "bfc87329-436a-4d96-8227-93f7434836a6",
      "name": "Send a photo message1",
      "webhookId": "cf8efe17-719b-4a16-82cc-d9536856cc40",
      "credentials": {
        "telegramApi": {
          "id": "W71JhaluJR5IFzk7",
          "name": "Telegram account 29"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendPhoto",
        "chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
        "file": "={{ $json['Image Link'] }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        2260,
        -260
      ],
      "id": "504257c5-2898-4b28-bb08-76874def4e23",
      "name": "Send a photo message2",
      "webhookId": "c0dffc66-4623-4593-9437-d2cf3a9cab83",
      "credentials": {
        "telegramApi": {
          "id": "W71JhaluJR5IFzk7",
          "name": "Telegram account 29"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendPhoto",
        "chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
        "file": "={{ $json['Image Link'] }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        2260,
        -60
      ],
      "id": "fc4649a2-12e6-4bbb-9d0b-dd6e93741e5d",
      "name": "Send a photo message3",
      "webhookId": "960d9179-b3c9-4968-b78a-12820a9a7249",
      "credentials": {
        "telegramApi": {
          "id": "W71JhaluJR5IFzk7",
          "name": "Telegram account 29"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendPhoto",
        "chatId": "={{ $('Telegram Trigger').first().json.message.chat.id }}",
        "file": "={{ $json['Image Link'] }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        2260,
        140
      ],
      "id": "4875b2b1-8149-4ee0-8a98-c42bc139974e",
      "name": "Send a photo message4",
      "webhookId": "8b44cd71-bf6b-4c15-a861-e262a62caa9d",
      "credentials": {
        "telegramApi": {
          "id": "W71JhaluJR5IFzk7",
          "name": "Telegram account 29"
        }
      }
    },
    {
      "parameters": {
        "content": "## Get Image + Brand",
        "height": 240,
        "width": 840,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -340,
        -340
      ],
      "id": "1ed0b803-aa75-4d3b-bd6d-d5d520482c15",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## Generate Image Prompts",
        "height": 460,
        "width": 540
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        540,
        -360
      ],
      "id": "f86bcca0-0ca2-416f-8e54-e144762dd014",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "## Generate Images",
        "height": 1020,
        "width": 1340,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1090,
        -720
      ],
      "id": "69adb78d-4cfe-492e-8e33-c753a41fbc7e",
      "name": "Sticky Note2"
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Set": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Instagram Post",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Instagram Story",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Website Banner",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Ad Creative",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Testimonial Graphic",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Instagram Post": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Upload Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File1": {
      "main": [
        [
          {
            "node": "Upload Image1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Instagram Story": {
      "main": [
        [
          {
            "node": "Convert to File1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File2": {
      "main": [
        [
          {
            "node": "Upload Image 2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Website Banner": {
      "main": [
        [
          {
            "node": "Convert to File2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File3": {
      "main": [
        [
          {
            "node": "Upload Image3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ad Creative": {
      "main": [
        [
          {
            "node": "Convert to File3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File4": {
      "main": [
        [
          {
            "node": "Upload Image4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Testimonial Graphic": {
      "main": [
        [
          {
            "node": "Convert to File4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Get Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Image": {
      "main": [
        [
          {
            "node": "Split",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Image 2": {
      "main": [
        [
          {
            "node": "Update sheet2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Image1": {
      "main": [
        [
          {
            "node": "Update sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Image4": {
      "main": [
        [
          {
            "node": "Update sheet4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Image3": {
      "main": [
        [
          {
            "node": "Update sheet3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Image": {
      "main": [
        [
          {
            "node": "Update sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update sheet": {
      "main": [
        [
          {
            "node": "Send a photo message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update sheet1": {
      "main": [
        [
          {
            "node": "Send a photo message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update sheet2": {
      "main": [
        [
          {
            "node": "Send a photo message2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update sheet3": {
      "main": [
        [
          {
            "node": "Send a photo message3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update sheet4": {
      "main": [
        [
          {
            "node": "Send a photo message4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d6e2bc14-a261-439d-b470-ed92f36223a5",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "7ff6625f0127f3e9a7865e3493009de1c48f57dc5ed87def3ae3316be7f6b238"
  },
  "id": "o1HlKsaY6cdKP3bP",
  "tags": []
}