AutomationFlowsAI & RAG › Generate UGC Images from Form Submissions

Generate UGC Images from Form Submissions

Original n8n title: Ugc Image Generator From Form Submission Using Nanobanana 🍌 and Telegram

UGC Image Generator from Form Submission using NanoBanana 🍌 and Telegram. Uses httpRequest, telegram, formTrigger. Event-driven trigger; 15 nodes.

Event trigger★★★★☆ complexity15 nodesHTTP RequestTelegramForm Trigger
AI & RAG Trigger: Event Nodes: 15 Complexity: ★★★★☆ Added:

This workflow follows the Form Trigger → 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 →

Download .json
{
  "id": "UM5yN01ZX3V2f256",
  "meta": {
    "site": "https://github.com/zengfr/n8n-workflow-all-templates",
    "name": "Generate UGC Images from Form Submissions with Google Gemini and Telegram",
    "wechat": "youandme10086",
    "id": 9922,
    "update_time": "2025-11-10"
  },
  "name": "UGC Image Generator from Form Submission using NanoBanana \ud83c\udf4c and Telegram",
  "tags": [],
  "nodes": [
    {
      "id": "15aee33e-9193-4bb2-9f9a-cc4ed5cd8eb5",
      "name": "Google gemini",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1168,
        0
      ],
      "parameters": {
        "url": "https://openrouter.ai/api/v1/chat/completions",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"model\": \"google/gemini-2.5-flash-image-preview\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": [\n        {\n          \"type\": \"text\",\n          \"text\": \"Create a realistic and engaging UGC image highlighting this Character product. : {{ $json.personnage }}. Style: lifestyle photo, taken on a smartphone, natural, authentic, and spontaneous atmosphere. Context: the subject holds/uses the product in a simple and natural way: natural light, simple background (living room, office, or urban outdoor setting), soft colors, mid-body framing. Objective: to give the impression that it is a real person recommending the product in UGC content.\"\n        },\n        {\n          \"type\": \"image_url\",\n          \"image_url\": {\n            \"url\": \"{{ $json.image }}\"\n          }\n        }\n      ]\n    }\n  ]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "openRouterApi"
      },
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4d644794-edfa-411e-950e-2a35aee608bf",
      "name": "Mapping",
      "type": "n8n-nodes-base.set",
      "position": [
        976,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "5ba24889-ccd2-4b28-be4e-ba85eb4a1827",
              "name": "image",
              "type": "string",
              "value": "={{ $json.image_url }}"
            },
            {
              "id": "cd52d79a-16b7-41ad-8673-e8a01fc0bd28",
              "name": "personnage",
              "type": "string",
              "value": "={{ $json.modele_personnage }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "813f07a4-a764-4284-9388-cc3a46b50c13",
      "name": "Send a photo message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1808,
        0
      ],
      "parameters": {
        "chatId": "@assistantjaures",
        "operation": "sendPhoto",
        "binaryData": true,
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "1a80e40a-b565-4a94-8d50-18ed5a12f2ff",
      "name": "Form submission with character type and image",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -144,
        -16
      ],
      "parameters": {
        "options": {
          "appendAttribution": false
        },
        "formTitle": "Advertising image generator",
        "formFields": {
          "values": [
            {
              "fieldType": "file",
              "fieldLabel": "Product image",
              "multipleFiles": false,
              "requiredField": true,
              "acceptFileTypes": ".jpg, .png, .jpeg"
            },
            {
              "fieldType": "dropdown",
              "fieldLabel": "Character model",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Homme"
                  },
                  {
                    "option": "Femme"
                  }
                ]
              },
              "requiredField": true
            }
          ]
        },
        "formDescription": "Turn simple product images into high-quality advertising images"
      },
      "typeVersion": 2.2
    },
    {
      "id": "76f275ec-0500-4df8-a533-1afd5e5ccf7a",
      "name": "Extract the form file",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        256,
        64
      ],
      "parameters": {
        "options": {},
        "operation": "binaryToPropery",
        "destinationKey": "image_base64",
        "binaryPropertyName": "Image_du_produit"
      },
      "typeVersion": 1
    },
    {
      "id": "68788867-9960-4c5e-a08c-802ce0604215",
      "name": "Merge the two data sets",
      "type": "n8n-nodes-base.merge",
      "position": [
        528,
        0
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2
    },
    {
      "id": "b95becf0-1bdd-4e55-9040-a428cd6eb3e3",
      "name": "Creating a data URL",
      "type": "n8n-nodes-base.code",
      "position": [
        752,
        0
      ],
      "parameters": {
        "jsCode": "// We take the first item.\nconst item = $input.item.json;\n\n// Character model retrieval\nconst modele = item[\"Mod\u00e8le de personnage\"];\n\n// Base64 recovery\nconst imageBase64 = item[\"image_base64\"];\n\n// Creating a Data URL that can be used in an API\n// \u26a1 Change \u201cimage/jpeg\u201d if your image is PNG.\nconst imageUrl = `data:image/jpeg;base64,${imageBase64}`;\n\n// Turn everything over\nreturn [\n  {\n    json: {\n      modele_personnage: modele,\n      image_url: imageUrl\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "80f40071-4c24-4dd5-bc6a-9cab0fcfa7e6",
      "name": "Transform URL data",
      "type": "n8n-nodes-base.code",
      "position": [
        1376,
        0
      ],
      "parameters": {
        "jsCode": "const output = items[0].json;\n\n// Extraire le base64 depuis choices[0].message.images[0].image_url.url\nlet base64Data = output.choices[0].message.images[0].image_url.url;\n\n// Enlever le pr\u00e9fixe \"data:image/png;base64,\"\nbase64Data = base64Data.replace(/^data:image\\/\\w+;base64,/, \"\");\n\n// Retourner dans un champ \"data\" \u2192 Convert to File va l'utiliser\nreturn [\n  {\n    json: {\n      data: base64Data\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "ef8c6191-80bf-40fb-ad4d-f7d9ad0d3978",
      "name": "Download the file",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1584,
        0
      ],
      "parameters": {
        "options": {},
        "operation": "toBinary",
        "sourceProperty": "data"
      },
      "typeVersion": 1.1
    },
    {
      "id": "23860a70-7beb-494d-a49b-bb7f83febb7d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        -128
      ],
      "parameters": {
        "color": 6,
        "width": 288,
        "height": 368,
        "content": "## Form Submission with Character Type and Image"
      },
      "typeVersion": 1
    },
    {
      "id": "e9f831db-eeb7-4780-8a96-6b237b6637f8",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        -128
      ],
      "parameters": {
        "color": 6,
        "width": 560,
        "height": 368,
        "content": "## Extract the Form File & Merge the Two Data Sets"
      },
      "typeVersion": 1
    },
    {
      "id": "b8431775-7a92-4174-a6aa-9da3ccb55ff3",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        -128
      ],
      "parameters": {
        "color": 6,
        "width": 592,
        "height": 368,
        "content": "## NanoBanana UGC image generator   "
      },
      "typeVersion": 1
    },
    {
      "id": "48eb75e1-ed81-471a-a774-d4caf3d52bbd",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1552,
        -128
      ],
      "parameters": {
        "color": 6,
        "width": 496,
        "height": 368,
        "content": "## UGCImage generated sent to Telegram"
      },
      "typeVersion": 1
    },
    {
      "id": "1cb6780e-468d-4b9e-87d2-dd5d0152db53",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        -352
      ],
      "parameters": {
        "color": 7,
        "width": 2400,
        "height": 752,
        "content": "## This workflow automates the creation of UGC (User-Generated Content) images by allowing users to submit a form containing:\n\nA character type selection (e.g., male or female)\n\nAn uploaded image (e.g., a photo or artwork)\n\nIt then processes the input, sends it to an AI model (Google Gemini via OpenRouter) to generate a creative response or description, and finally posts the image + AI-generated content to a Telegram channel."
      },
      "typeVersion": 1
    },
    {
      "id": "fd1e5d7b-bbcb-4478-aa8e-18d85503c8e9",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1072,
        -352
      ],
      "parameters": {
        "width": 720,
        "height": 1344,
        "content": "## This workflow automates the process of generating personalized UGC (User-Generated Content) images based on form submissions.\n\nIt accepts a form with a character type (e.g., male/female) and an uploaded image, merges them, sends them to an AI model (Google Gemini via OpenRouter) for creative generation, and posts the resulting content as a Telegram photo message.\n\n## Who\u2019s it for\n\nThis automation template is designed for marketers, AI creators, content teams, or interactive community platforms that want to let users submit content (image + character type), enrich it with AI-generated descriptions, and instantly publish results to Telegram \u2014 without writing a single line of code.\n\n## How it works\n\n- Trigger: Workflow starts when a form is submitted by a user.\n\n- Extract file: The uploaded image file is converted to a Base64 string.\n\n- Merge data: The character type and image data are combined into one payload.\n\n- Format to Data URL: The image is wrapped as a proper data:image/... format for API use.\n\n- Prepare payload: The text and image are mapped into a structure compatible with Gemini API.\n\n- Generate AI content: Sends the input to Google Gemini (via OpenRouter) to generate a UGC description.\n\n- Transform response: Cleans and extracts the result from Gemini\u2019s response.\n\n- Convert back to file: Transforms the Base64 image back into a real image file.\n\n- Send to Telegram: The image and its AI-generated description are sent as a photo message to your Telegram channel.\n\n## How to use\n\n- Set up a form with a dropdown for character type (e.g., Male/Female) and an image upload field.\n\n- Configure the Gemini API access through OpenRouter.\n\n- Connect your Telegram bot and channel to receive the final result.\n\n- Start the workflow \u2192 users submit the form, and their data is processed and shared as AI-enhanced UGC.\n\n## Requirements\n\n- OpenRouter API key to access Google Gemini.\n\n- A Telegram Bot connected to your Telegram channel.\n\n## \u2753 Need help\n\n**Contact me for consulting and support:** [LinkedIn](https://www.linkedin.com/in/jaures-nya-83a033270/) / [YouTube](https://www.youtube.com/@jauresnya) / [Skool](https://www.skool.com/gaia-4903/about?ref=e0430e4c35b645ac8976b952768e9d55)  "
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "45583225-c701-4d95-8ca6-6f650fdd08ad",
  "connections": {
    "Mapping": {
      "main": [
        [
          {
            "node": "Google gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google gemini": {
      "main": [
        [
          {
            "node": "Transform URL data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download the file": {
      "main": [
        [
          {
            "node": "Send a photo message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transform URL data": {
      "main": [
        [
          {
            "node": "Download the file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Creating a data URL": {
      "main": [
        [
          {
            "node": "Mapping",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract the form file": {
      "main": [
        [
          {
            "node": "Merge the two data sets",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge the two data sets": {
      "main": [
        [
          {
            "node": "Creating a data URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Form submission with character type and image": {
      "main": [
        [
          {
            "node": "Merge the two data sets",
            "type": "main",
            "index": 0
          },
          {
            "node": "Extract the form file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

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

Pro

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

About this workflow

UGC Image Generator from Form Submission using NanoBanana 🍌 and Telegram. Uses httpRequest, telegram, formTrigger. Event-driven trigger; 15 nodes.

Source: https://github.com/zengfr/n8n-workflow-all-templates/blob/6a3e60251e39ea8c87e061d82f52633e5d0debe6/n8n-workflow-all-templates/00/00/99/9922_Generate_UGC_Images_from_Form_Submissions_with_Google_Gemini_and_Telegram.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

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

AI & RAG

Transform text prompts into stunning images or edit existing visuals using OpenAI's latest GPT-4 Vision model through an intuitive web form interface.

Google Drive, HTTP Request, Form Trigger +1
AI & RAG

It accepts a form with a character type (e.g., male/female) and an uploaded image, merges them, sends them to an AI model (Google Gemini via OpenRouter) for creative generation, and posts the resultin

HTTP Request, Telegram, Form Trigger
AI & RAG

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Airtable, OpenAI, Form Trigger +3
AI & RAG

This workflow showcases various useful Gmail search, filter, and AI categorization operations and generates a knowledge graph for your mail using the InfraNodus GraphRAG API, which you can use to reve

HTTP Request, Google Gemini Chat, Gmail +3
AI & RAG

This workflow was built to solve a real, painful creator problem: you know what to explain, but you don’t like how you sound, hesitate while speaking, or don’t feel fluent enough on camera.

Form Trigger, Ftp, Ssh +4