Telegram + Google Sheets: AI images you can reuse
Your best image ideas show up at the worst time. You DM yourself a prompt in Telegram, generate something later, then… it vanishes into a downloads folder, a random Drive link, or an old chat thread you’ll never search again.
This is where Telegram image automation pays off fast. Marketing managers trying to keep campaigns consistent feel it first, but founders and agency creatives get stuck in the same loop. You want reusable assets, not one-off images you can’t find when you need them.
This workflow turns a simple Telegram message into an AI image, sends it back to you, and logs it in Google Sheets (with an optional Drive upload) so your assets stay searchable. You’ll see how it works, what you need, and where teams usually trip up.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Telegram + Google Sheets: AI images you can reuse
flowchart LR
subgraph sg0["Telegram Flow"]
direction LR
n0@{ icon: "mdi:robot", form: "rounded", label: "Image Prompt", pos: "b", h: 48 }
n1@{ icon: "mdi:cog", form: "rounded", label: "Google Drive", pos: "b", h: 48 }
n2@{ icon: "mdi:database", form: "rounded", label: "Image Log", pos: "b", h: 48 }
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/telegram.svg' width='40' height='40' /></div><br/>Send Photo"]
n4["<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/>Telegram Trigger"]
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/httprequest.dark.svg' width='40' height='40' /></div><br/>Create Image"]
n6@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model", pos: "b", h: 48 }
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/httprequest.dark.svg' width='40' height='40' /></div><br/>HTTP Request"]
n5 --> n7
n1 --> n2
n7 --> n1
n7 --> n3
n0 --> n5
n4 --> n0
n6 -.-> n0
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 n4 trigger
class n0 ai
class n6 aiModel
class n2 database
class n5,n7 api
classDef customIcon fill:none,stroke:none
class n3,n4,n5,n7 customIcon
The Problem: AI images get created, then lost
Generating images is the easy part. The messy part is everything around it: rewriting prompts so they’re detailed enough, tracking which concept you used for which campaign, and saving the final image somewhere your team can actually reuse. In practice, it turns into scattered links, inconsistent naming, and “Can you resend that one from last week?” messages that derail your day. After a month, you’ve created dozens of assets but you can’t confidently answer basic questions like which style performed best, or what prompt produced that hero image your client liked.
It adds up fast. Here’s where it usually breaks down.
- You retype or “polish” prompts every time, which burns creative energy on repeat work.
- Images get saved inconsistently, so the same idea gets generated twice because nobody can find the original.
- Sharing is clunky, and approvals stall when the only “system” is scrolling through Telegram.
- Without a log of titles, links, and dates, scaling from a few images to a real library becomes chaos.
The Solution: Telegram-to-OpenAI images with a searchable log
This n8n workflow listens for new messages sent to your Telegram bot and treats each message as a rough image idea. It then expands that idea using an OpenAI chat model, turning “quick thoughts” into a richer prompt with style, context, and useful detail. Next, the workflow sends the expanded prompt to OpenAI’s image endpoint to generate the image. When the file is ready, n8n fetches it, sends the finished image back to you in Telegram, and (optionally) stores it in a Google Drive folder. Finally, it logs the image record in Google Sheets so you can search, filter, and reuse assets later without guessing where anything went.
The workflow starts with a Telegram message. OpenAI turns that message into a production-ready prompt, then generates the image. From there, the image is delivered back to Telegram and saved with a clean record in Google Sheets (plus Drive storage if you enable it).
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you create 20 campaign images a week. Manually, you might spend about 10 minutes writing a better prompt, 5 minutes generating, and another 5 minutes saving and documenting the link, which is roughly 20 minutes per image (around 6 hours a week). With this workflow, you send a Telegram message in under a minute, wait for the image generation, and the Drive/Sheets logging happens in the background. You still review the output, but the busywork mostly disappears, so that weekly admin time drops to about an hour.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Telegram to collect prompts and deliver images.
- OpenAI for prompt expansion and image generation.
- Telegram bot token (get it from @BotFather in Telegram)
- OpenAI API key (get it from platform.openai.com)
- Google Sheets to log titles and links (optional).
- Google Drive to store images in a folder (optional).
Skill level: Beginner. You’ll paste API keys, connect Google, and update a folder and sheet ID if you enable logging.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A Telegram message triggers everything. You send your bot an idea like “a futuristic coffee shop at sunrise” and n8n captures that message instantly.
The idea gets upgraded into a real prompt. An OpenAI chat model expands your short text into something more descriptive, so the image generator has enough detail to stay consistent across a series.
OpenAI generates the image and n8n fetches the file. The workflow sends the expanded prompt to the image API, then downloads the resulting image so it can be reused elsewhere (not just viewed in a response).
The output gets delivered and organized. The image is sent back to you in Telegram, stored in a Google Drive folder if you enable that node, and a Google Sheets row is created so you can search by title, date, or campaign later.
You can easily modify the prompt style to match your brand voice based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Telegram Trigger
Set up the workflow entry point so Telegram messages initiate the automation.
- Add the Incoming Telegram Start node as the trigger.
- Set Updates to
message. - Credential Required: Connect your
telegramApicredentials in Incoming Telegram Start.
Step 2: Set Up the AI Prompt Composer
Use the agent and language model to transform the Telegram message into an optimized image prompt.
- Add Compose Image Prompt and set Text to
{{ $json.message.text }}. - In Compose Image Prompt, keep Prompt Type set to
defineand set System Message toOverview\nYou are an expert image prompt engineer.. - Add OpenAI Chat Engine and select the model
gpt-4o-mini. - Credential Required: Connect your
openAiApicredentials in OpenAI Chat Engine. - Ensure OpenAI Chat Engine is connected as the language model for Compose Image Prompt (credentials should be added to OpenAI Chat Engine, not the agent node).
Step 3: Configure the Image Generation Requests
Send the generated prompt to the image API and retrieve the resulting file.
- Add Generate Image Request and set URL to
https://api.openai.com/v1/images/generations. - Set Method to
POST, enable Send Body and Send Headers. - Under Body Parameters, set prompt to
{{ $json.output }}and size to1024x1024. - Under Header Parameters, set Authorization to
Bearer [CONFIGURE_YOUR_TOKEN]. - Add Fetch Image File and set URL to
{{ $json.data[0].url }}.
[CONFIGURE_YOUR_TOKEN] with your actual OpenAI API key before testing.Step 4: Configure Output Destinations
Save the generated image to Drive, log it in Sheets, and send it back to Telegram. The workflow branches in parallel after the image file is fetched.
- Connect Fetch Image File to both Store in Drive Folder and Dispatch Photo Message in parallel.
- In Store in Drive Folder, set Name to
ai image, Drive toMy Drive, and Folder to/ (Root folder). - Credential Required: Connect your
googleDriveOAuth2Apicredentials in Store in Drive Folder. - Connect Store in Drive Folder to Log Image Record and set Operation to
append. - In Log Image Record, set Document to
[YOUR_ID]and Sheet toSheet1(gid=0). - Map Title to
{{ $json.name }}and Heygen video url to{{ $json.webViewLink }}. - Credential Required: Connect your
googleSheetsOAuth2Apicredentials in Log Image Record. - In Dispatch Photo Message, set Operation to
sendPhoto, enable Binary Data, and set Chat ID to{{ $('Incoming Telegram Start').item.json.message.from.id }}. - Credential Required: Connect your
telegramApicredentials in Dispatch Photo Message.
Step 5: Test and Activate Your Workflow
Validate the end-to-end flow and turn the automation on for production use.
- Click Execute Workflow and send a Telegram message to your bot to trigger Incoming Telegram Start.
- Confirm Compose Image Prompt outputs a refined prompt and Generate Image Request returns a URL.
- Verify that Dispatch Photo Message sends an image back to the originating Telegram chat.
- Check that Store in Drive Folder uploads the image and Log Image Record appends a new row with the file name and link.
- Toggle the workflow to Active once results are correct.
Common Gotchas
- Telegram bot credentials can expire or be pasted incorrectly. If replies suddenly stop, check the bot token in n8n Credentials and confirm the bot still works in Telegram.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Frequently Asked Questions
About 30 minutes if you already have your API keys.
No. You’ll mostly connect accounts and paste credentials into n8n.
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 OpenAI API costs, which are usually a few cents per image depending on model and size.
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 “Compose Image Prompt” prompt so it always includes your style rules (colors, lighting, composition, “avoid text,” and so on). You can also swap the image generation settings in the “Generate Image Request” node to change size/quality, then keep the same Google Sheets logging so everything stays searchable.
Most of the time it’s the bot token, not the workflow. Regenerate or re-copy the token from @BotFather, then update the Telegram credentials in n8n and re-test by sending a fresh message. Also confirm your Telegram Trigger is the active trigger node, because importing templates sometimes leaves the workflow inactive. If it fails only during busy periods, Telegram or your server may be rate limiting, so slowing requests (or moving to n8n Cloud) can help.
A lot, but it depends on where you run it. On n8n Cloud, your monthly execution limit depends on plan, and each image typically uses a few executions across prompt expansion, generation, fetching, and logging. If you self-host, there’s no fixed execution cap, but throughput depends on your server and OpenAI rate limits. In practical terms, most small teams run dozens to a few hundred images a week without thinking about it, then adjust once they scale.
Often, yes, because this flow is more than a simple “trigger → action.” n8n handles multi-step logic (expand prompt, generate, fetch file, store, log, respond) without feeling like you’re fighting the tool or paying extra for branching. Self-hosting is also a big deal if you want unlimited runs and more control over data. Zapier or Make can still be fine if you only need a lightweight two-step automation and don’t care about custom prompt logic. If you’re unsure, Talk to an automation expert and we’ll sanity-check your use case.
Once this is running, your best ideas don’t disappear. They turn into usable assets with a paper trail in Sheets, ready for the next campaign.
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.