Google Gemini to Telegram, UGC posts ready to share
UGC content should feel fast, but the “last mile” is where it falls apart. Someone uploads an image, notes get lost in chat, captions get rewritten three times, and the post that finally goes out is… fine. Not on-brand. Not consistent.
This kind of UGC caption automation hits marketers first, because they own quality and speed. But content managers and community leads feel the mess too, especially when submissions come in all day.
This workflow takes a simple form submission (character type + image), uses Google Gemini to generate a ready-to-post caption, then publishes the image and copy to Telegram automatically. You’ll see how it works, what you need, and what to watch out for.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Google Gemini to Telegram, UGC posts ready to share
flowchart LR
subgraph sg0["Form submission with character type and image Flow"]
direction LR
n0["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Google gemini"]
n1@{ icon: "mdi:swap-vertical", form: "rounded", label: "Mapping", pos: "b", h: 48 }
n2["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Send a photo message"]
n3["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/form.svg' width='40' height='40' /></div><br/>Form submission with charact.."]
n4@{ icon: "mdi:cog", form: "rounded", label: "Extract the form file", pos: "b", h: 48 }
n5["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/merge.svg' width='40' height='40' /></div><br/>Merge the two data sets"]
n6["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Creating a data URL"]
n7["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>Transform URL data"]
n8@{ icon: "mdi:cog", form: "rounded", label: "Download the file", pos: "b", h: 48 }
n1 --> n0
n0 --> n7
n8 --> n2
n7 --> n8
n6 --> n1
n4 --> n5
n5 --> n6
n3 --> n5
n3 --> n4
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n3 trigger
class n0 api
class n6,n7 code
classDef customIcon fill:none,stroke:none
class n0,n2,n3,n5,n6,n7 customIcon
The Problem: UGC Submissions Create Posting Chaos
When UGC comes in through forms, DMs, emails, and “quick Slack messages,” you end up doing the same work over and over. Download the image. Rename it. Ask what the user meant. Write a caption. Then rewrite it because it doesn’t match your tone. Finally, you post it to the right channel and hope you didn’t miss a detail. It’s not just time. It’s attention. And once your brain is fried, mistakes sneak in: the wrong image, the wrong phrasing, or a caption that sounds nothing like your brand.
It adds up fast. Here’s where the friction usually shows up.
- Each submission becomes a mini project, and “quick posting” turns into about 20 minutes of back-and-forth.
- Captions drift over time, so your UGC feed starts sounding like five different brands.
- Files get mishandled during downloads and re-uploads, which leads to broken formats or the wrong asset posted.
- Manual publishing means someone has to be “on” all day, even when the work is repetitive.
The Solution: Form-to-Telegram UGC Publishing With Gemini
This workflow starts at the moment someone submits a form with two things: a character type (like male/female, or any label you choose) and an uploaded image. n8n grabs the file, converts it into a format Gemini can understand, then sends both the image and the character choice to Google Gemini through OpenRouter. Gemini generates a creative, usable UGC-style description, which is then cleaned up and pulled into a final caption. After that, the workflow converts the image back into a normal file and posts it to your Telegram channel as a photo message with the caption attached. The result is simple: submissions turn into share-ready UGC posts without you babysitting the process.
The workflow begins with a form trigger, then does file handling (binary to Base64 and back) so the AI and Telegram both get what they need. In the middle, Gemini generates the on-brand text. At the end, Telegram receives a neat post: image plus caption, ready for your team to approve, forward, or publish elsewhere.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say your community generates 15 UGC submissions a week. Manually, it’s easy to spend about 20 minutes per submission downloading files, writing captions, and posting to Telegram, which is roughly 5 hours a week. With this workflow, the “work” is basically reviewing what shows up in Telegram: maybe 1 minute to skim and react, so around 15 minutes total. You still control what gets used, but the busywork mostly disappears.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- OpenRouter to access Google Gemini via API.
- Telegram Bot to post into your channel automatically.
- OpenRouter API key (get it from your OpenRouter dashboard)
Skill level: Beginner. You’ll connect accounts, paste an API key, and test with a few sample submissions.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
Form submission triggers everything. When a user uploads an image and chooses a character type, n8n captures both fields immediately so nothing gets lost in chat threads.
The image is prepared for AI. The workflow extracts the uploaded file, converts it to Base64, then wraps it as a proper data:image URL so Google Gemini can read it reliably through OpenRouter.
Gemini generates the caption. n8n sends the character type plus the image payload to Gemini, then cleans the response so you get just the usable description, not extra formatting or API wrapper text.
Telegram receives a ready-to-share post. The image is converted back into a normal file, then your Telegram bot publishes it to the chosen channel with the AI-generated caption attached.
You can easily modify the character dropdown to match your own categories and adjust the caption style to match your brand voice. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Form Trigger
Set up the form that captures the product image and character model selection.
- Add the Form Intake Trigger node and set Form Title to
Advertising image generator. - Set Form Description to
Turn simple product images into high-quality advertising images. - Add a file field labeled
Product imagewith accepted types.jpg, .png, .jpeg. - Add a dropdown field labeled
Character modelwith optionsHommeandFemme. - Note that Form Intake Trigger outputs to both Combine Form Data and Extract Upload Binary in parallel.
Tip: The Flowpast Branding sticky note is informational only and does not affect execution.
Step 2: Prepare and Map Form Data
Convert the upload into base64, merge it with form fields, and map the inputs needed for the image request.
- In Extract Upload Binary, set Operation to
binaryToPropery, Destination Key toimage_base64, and Binary Property Name toImage_du_produit. - In Combine Form Data, set Mode to
combineand Combine By tocombineByPosition. - In Build Data URL, keep the provided code that converts
image_base64to a data URL and mapsmodele_personnageandimage_url. - In Map Input Fields, set image to
={{ $json.image_url }}and personnage to={{ $json.modele_personnage }}. - Verify the flow: Extract Upload Binary → Combine Form Data → Build Data URL → Map Input Fields.
⚠️ Common Pitfall: If the file field name in the form does not match Image_du_produit, Extract Upload Binary will not find the binary data. Align the field name or update Binary Property Name accordingly.
Step 3: Set Up the AI Image Request
Configure the API call that generates the UGC-style image using the mapped inputs.
- Add the Gemini Image Request node and set URL to
https://openrouter.ai/api/v1/chat/completions. - Set Method to
POSTand Specify Body tojson. - Use the provided JSON body with expressions, including
{{ $json.personnage }}and{{ $json.image }}. - Credential Required: Connect your openRouterApi credentials.
- Confirm the flow: Map Input Fields → Gemini Image Request.
Step 4: Parse the Response and Send to Telegram
Extract the base64 image from the API response, convert it to binary, and post it to Telegram.
- In Parse Image Payload, keep the code that extracts
choices[0].message.images[0].image_url.urland strips the data URL prefix. - In Convert to Binary File, set Operation to
toBinaryand Source Property todata. - In Post Telegram Photo, set Operation to
sendPhoto, enable Binary Data, and set Chat ID to your target ID (replace[YOUR_ID]). - Credential Required: Connect your telegramApi credentials.
- Confirm the flow: Gemini Image Request → Parse Image Payload → Convert to Binary File → Post Telegram Photo.
Step 5: Test and Activate Your Workflow
Run a full test to validate form input, image generation, and Telegram delivery.
- Click Execute Workflow and submit a form entry with a valid image and character model.
- Confirm that Gemini Image Request returns a response containing
choices[0].message.images[0].image_url.url. - Verify that Post Telegram Photo sends a photo message to the configured chat.
- When satisfied, toggle the workflow to Active for production use.
Common Gotchas
- Telegram credentials can expire or your bot can lose permission to post. If things break, check the bot’s admin rights in the target channel first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- OpenRouter (Gemini) requests can fail from missing billing, a revoked API key, or rate limits during spikes. Check your OpenRouter dashboard logs, then re-paste the key in n8n if needed.
Frequently Asked Questions
About 30 minutes if you already have your Telegram bot and OpenRouter key.
No. You will connect Telegram and paste your OpenRouter API key. The rest is mapping a couple of form fields and testing with a sample upload.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenRouter/Gemini API costs, which are usually a few cents per generated post depending on your model settings.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and you should. The easiest win is updating the prompt content sent in the Gemini Image Request step so it uses your tone, banned phrases, and CTA style. You can also change the dropdown values in your form (not just male/female) and map them in Map Input Fields so Gemini gets the right context. Common tweaks include adding product names, forcing a caption length, or generating multiple options and choosing one before Telegram posts.
Usually it’s the bot not having permission to post in the channel, or the chat ID/channel target being wrong. Double-check that the bot is an admin in the channel and that your n8n Telegram credentials still authorize the same bot. If it worked once and then stopped, regenerate the bot token and update it in n8n.
A lot, as long as you size your n8n plan and API limits to match.
Often, yes, for this specific use case. You’re dealing with file handling (binary uploads, Base64 conversion), a multimodal AI call (image + text), and then a media post to Telegram. n8n is simply more comfortable in that “real workflow” territory, and self-hosting is an option if volume grows. Zapier or Make can still do it, but you may end up fighting file size limits, premium steps, or awkward formatting. If you want someone to sanity-check the best stack for your workflow, Talk to an automation expert.
Once this is running, your UGC pipeline stops depending on someone remembering every little step. The workflow posts clean, consistent drafts to Telegram, and you keep your time for decisions that actually matter.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.