AI Agents

Generate Trending Instagram Content Using AI Image Creation

44 nodes 334 175 Scheduled trigger
Download

Workflow Description

Scheduled automation that generates Instagram content using OpenAI for copywriting and intelligent image creation, stores data in Postgres, and distributes results through Telegram and Facebook for review and publishing.

How it works

  1. 1.Run a scheduled trigger that identifies trending content topics
  2. 2.Generate captions and images using OpenAI based on current trends
  3. 3.Store generated content in Postgres database for record-keeping
  4. 4.Distribute batches of content to Telegram groups for team review
  5. 5.Publish approved content directly to Instagram via Facebook Graph API

Use cases

  • Digital marketing agencies managing multiple client accounts
  • Content creators seeking to accelerate production workflows
  • Small businesses lacking dedicated in-house content teams

Requirements

  • Active OpenAI API key with available credits
  • Configured Postgres database with proper access credentials
  • Telegram bot and channel or group for content distribution
  • Authorized Facebook app with Instagram publishing permissions

Service Value

Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.

Apps Used

Telegram Split In Batches Postgres OpenAI Facebook

Details

Trigger Scheduled trigger
Nodes 44
Apps 5
Views 334
Downloads 175

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (44)

/

If media status is finished

If

#1

If media status is finished1

If

#2

Telegram

Set

#3

Telegram1

Set

#4

Telegram2

Set

#5

Loop Over Items

Split In Batches

#6

Schedule Trigger1

Schedule Trigger

#7

Telegram Params

Set

#8

Instagram params

Set

#9

Sticky Note2

Sticky Note

#10

Rapid Api params

Set

#11

filter the image content

Code

#12

get top trends on instagram #blender3d

HTTP Request

#13

get top trends on instagram #isometric

HTTP Request

#14

merge the array content

Merge

#15

Sticky Note3

Sticky Note

#16

Sticky Note4

Sticky Note

#17

Sticky Note5

Sticky Note

#18

Sticky Note6

Sticky Note

#19

Sticky Note7

Sticky Note

#20

Sticky Note8

Sticky Note

#21

Check Data on Database Is Exist

Postgres

#22

If Data is Exist

If

#23

Sticky Note9

Sticky Note

#24

send error message to telegram

Set

#25

insert data on db

Postgres

#26

Analyze Image and give the content

OpenAI

#27

Analyze Content And Generate Instagram Caption

OpenAI

#28

Sticky Note

Sticky Note

#29

Prepare data on Instagram

Facebook Graph Api

#30

Check Status Of Media Before Uploaded

Facebook Graph Api

#31

Publish Media on Instagram

Facebook Graph Api

#32

Check status of post

Facebook Graph Api

#33

Sticky Note1

Sticky Note

#34

Sticky Note10

Sticky Note

#35

filter the image content-2

Code

#36

Sticky Note11

Sticky Note

#37

Replicate params

Set

#38

Generate image on flux

HTTP Request

#39

Sticky Note12

Sticky Note

#40

Sticky Note13

Sticky Note

#41

Sticky Note14

Sticky Note

#42

Sticky Note15

Sticky Note

#43

Sticky Note16

Sticky Note

#44