# Generate Instagram content from top trends with OpenAI: n8n workflow

> Started by a clock, and works across Postgres and Telegram. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/generate-instagram-content-from-top-trends-with-openai (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 Instagram content from top trends with OpenAI

Started by a clock, and works across Postgres and Telegram. It hands the judgement calls to OpenAI. 27 steps, 3 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fgenerate-instagram-content-from-top-trends-with-openai)

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

**3** Branches: places the flow splits

**1** Loop or waits

**2** Services it connects to

## The flow

Starts it 1 Model 2 Logic 11 Service 13

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

- 1 **Schedule Trigger1** Schedule trigger *Starts it*
- 2 **Replicate params** Set *Logic*
- 3 **Instagram params** Set *Logic*
- 4 **Telegram Params** Set *Logic*
- 5 **Rapid Api params** Set *Logic*
- 6 **get top trends on instagram #isometric** Http Request *Service*
- 7 **get top trends on instagram #blender3d** Http Request *Service*
- 8 **filter the image content** Code *Logic*
- 9 **filter the image content-2** Code *Logic*
- 10 **merge the array content** Merge *Logic*
- 11 **Loop Over Items** Split In Batches *Logic*
- 12 **Check Data on Database Is Exist** Postgres *Service*
- 13 **If Data is Exist** If *Logic*
- 14 **send error message to telegram** Telegram *Service*
- 15 **insert data on db** Postgres *Service*
- 16 **Analyze Image and give the content** Open Ai *Model*
- 17 **Analyze Content And Generate Instagram Caption** Open Ai *Model*
- 18 **Generate image on flux** Http Request *Service*
- 19 **Prepare data on Instagram** Facebook Graph Api *Service*
- 20 **Check Status Of Media Before Uploaded** Facebook Graph Api *Service*
- 21 **If media status is finished** If *Logic*
- 22 **Publish Media on Instagram** Facebook Graph Api *Service*
- 23 **Telegram** Telegram *Service*
- 24 **Check status of post** Facebook Graph Api *Service*
- 25 **If media status is finished1** If *Logic*
- 26 **Telegram1** Telegram *Service*
- 27 **Telegram2** Telegram *Service*

## How it's built

- **Starts on:** A clock
- **Steps:** 27, with 3 branches, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Postgres, Telegram
- **Model:** OpenAI

## Questions

What does it need to run?

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

What starts it?

It starts on a clock.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 27 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 27 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-instagram-content-from-top-trends-with-openai)
- **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.

[Postgres](https://millionrounds.com/workflows?service=Postgres#library)[Telegram](https://millionrounds.com/workflows?service=Telegram#library)

## Workflows like it

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

- [**AI content creation and publishing engine with Mistral** 27 steps · calls a model · Telegram, YouTube](https://millionrounds.com/workflow/ai-content-creation-and-publishing-engine-with-mistral)
- [**Automated Instagram content creation from trending posts** 27 steps · calls a model · Postgres, Telegram](https://millionrounds.com/workflow/automated-instagram-content-creation-from-trending-posts)
- [**Maintain RAG embeddings with OpenAI and Postgres** 27 steps · calls a model · Postgres, in-memory vectors](https://millionrounds.com/workflow/maintain-rag-embeddings-with-openai-and-postgres)
- [**Async Video Polling Engine - Background Job Handler** 27 steps · Redis, S3](https://millionrounds.com/workflow/async-video-polling-engine-background-job-handler)
- [**Auto-create TikTok videos with VEED.io AI and ElevenLabs** 28 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/auto-create-tiktok-videos-with-veed-io-ai-and-elevenlabs)
- [**Auto-generate social media videos with OpenAI and Blotato** 28 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/auto-generate-social-media-videos-with-openai-and-blotato)
