# Generate AI photos with Gemini and Instagram: n8n workflow

> Started by an incoming Telegram message, and works across Google Drive, Google Sheets and Telegram.

Source: https://millionrounds.com/workflow/generate-ai-photos-with-gemini-and-instagram (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Content](https://millionrounds.com/workflows?category=Content#library)

# Generate AI photos with Gemini and Instagram

Started by an incoming Telegram message, and works across Google Drive, Google Sheets and Telegram. It puts Gemini and OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 44 steps, 9 branches, 6 loops or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: Gemini, OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fgenerate-ai-photos-with-gemini-and-instagram)

**44 steps** Large: read it before trusting it with anything live

**9** Branches: places the flow splits

**6** Loops or waits

**3** Services it connects to

## The flow

Starts it 1 Model 5 Logic 17 Service 21

The steps in the order they run, from what starts it.

- 1 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 2 **Listen for incoming events** Telegram trigger *Starts it*
- 3 **Window Buffer Memory** Memory Buffer Window *Model*
- 4 **AI Agent** Agent *Model*
- 5 **Voice or Text** Set *Logic*
- 6 **Approved from user?** If *Logic*
- 7 **A Voice?** If *Logic*
- 8 **Parse AI Output** Code *Logic*
- 9 **Send questions or proposal to user** Telegram *Service*
- 10 **Get Voice File** Telegram *Service*
- 11 **Inform user about processing** Telegram *Service*
- 12 **Speech to Text** Open Ai *Model*
- 13 **Save Prompt & Post-Text** Google Sheets *Service*
- 14 **Generate an image** Google Gemini *Model*
- 15 **Upload image1** Google Drive *Service*
- 16 **Send a photo message** Telegram *Service*
- 17 **Download image from Drive** Google Drive *Service*
- 18 **Send message and wait for response** Telegram *Service*
- 19 **If1** If *Logic*
- 20 **Upload media1** Blotato *Service*
- 21 **Create instagram Post** Blotato *Service*
- 22 **Create x post** Blotato *Service*
- 23 **Create FB post** Blotato *Service*
- 24 **Wait1** Wait *Logic*
- 25 **Wait** Wait *Logic*
- 26 **Wait2** Wait *Logic*
- 27 **Get post1** Blotato *Service*
- 28 **Check Post Status** Blotato *Service*
- 29 **Check Post Status1** Blotato *Service*
- 30 **Published to Instagram?** If *Logic*
- 31 **Published to X?** If *Logic*
- 32 **Published to Facebook?** If *Logic*
- 33 **Confirm publishing to Instagram** Telegram *Service*
- 34 **In Progress?1** If *Logic*
- 35 **Confirm publishing to X** Telegram *Service*
- 36 **In Progress?** If *Logic*
- 37 **Confirm publishing to Facebook** Telegram *Service*
- 38 **In Progress?2** If *Logic*
- 39 **Give Blotat more time** Wait *Logic*
- 40 **Send Instagram Error Message** Telegram *Service*
- 41 **Give Blotat other 5s:)** Wait *Logic*
- 42 **Send X Error Message** Telegram *Service*
- 43 **Give Blotat other 5s:)1** Wait *Logic*
- 44 **Send Facebook Error Message** Telegram *Service*

## How it's built

- **Starts on:** An incoming Telegram message
- **Steps:** 44, with 9 branches, 6 loops or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Google Drive, Google Sheets, Telegram
- **Model:** Gemini, OpenAI
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Google Drive, Google Sheets and Telegram accounts, and a key for Gemini and OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an incoming Telegram message.

Does it use AI?

Yes. It calls Gemini and OpenAI. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 44 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 44 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fgenerate-ai-photos-with-gemini-and-instagram)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Google Drive](https://millionrounds.com/workflows?service=Google+Drive#library)[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)[Telegram](https://millionrounds.com/workflows?service=Telegram#library)

## Workflows like it

Also content, with the same services where possible, closest in size first.

- [**Automate YouTube Content Strategy with Google Sheets** 44 steps · calls a model · Google Sheets, Slack](https://millionrounds.com/workflow/automate-youtube-content-strategy-with-google-sheets)
- [**Create blog posts from YouTube videos with a local model** 43 steps · calls a model · Google Sheets, RSS](https://millionrounds.com/workflow/create-blog-posts-from-youtube-videos-with-a-local-model)
- [**Generate high quality video commercials with DeepSeek** 43 steps · calls a model · Google Cloud Storage, Google Drive](https://millionrounds.com/workflow/generate-high-quality-video-commercials-with-deepseek)
- [**Automate Telegram channel posts with Postgres** 43 steps · Postgres, Telegram](https://millionrounds.com/workflow/automate-telegram-channel-posts-with-postgres)
- [**Generate a full startup plan from one sentence with Postgres** 43 steps · Gmail, Google Drive](https://millionrounds.com/workflow/generate-a-full-startup-plan-from-one-sentence-with-postgres)
- [**AI Agents Generate Content & Automate Posting** 46 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/ai-agents-generate-content-and-automate-posting)
