Generate Instagram Content from Top Trends with AI Image Generation
Configured with Facebook Graph Api, HTTP Request, Open Ai, Postgres, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Routing
- Messaging
- Trigger
- Transform
- Code
- Web / API
- Data store
- AI & models
- Integration
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| If media status is finished | Routing | If | See node parameters |
| If media status is finished1 | Routing | If | See node parameters |
| Telegram | Messaging | Telegram | See node parameters |
| Telegram1 | Messaging | Telegram | See node parameters |
| Telegram2 | Messaging | Telegram | See node parameters |
| Loop Over Items | Routing | Loop Over Items | See node parameters |
| Schedule Trigger1 | Trigger | Schedule Trigger | See node parameters |
| Telegram Params | Transform | Edit Fields | See node parameters |
| Instagram params | Transform | Edit Fields | See node parameters |
| Rapid Api params | Transform | Edit Fields | See node parameters |
| filter the image content | Code | Code | See node parameters |
| get top trends on instagram #blender3d | Web / API | HTTP Request | See node parameters |
| get top trends on instagram #isometric | Web / API | HTTP Request | See node parameters |
| merge the array content | Transform | Merge | See node parameters |
| Check Data on Database Is Exist | Data store | Postgres | select |
| If Data is Exist | Routing | If | See node parameters |
| send error message to telegram | Messaging | Telegram | See node parameters |
| insert data on db | Data store | Postgres | See node parameters |
| Analyze Image and give the content | AI & models | Open Ai | image / analyze |
| Analyze Content And Generate Instagram Caption | AI & models | Open Ai | See node parameters |
| Prepare data on Instagram | Integration | Facebook Graph Api | See node parameters |
| Check Status Of Media Before Uploaded | Integration | Facebook Graph Api | See node parameters |
| Publish Media on Instagram | Integration | Facebook Graph Api | See node parameters |
| Check status of post | Integration | Facebook Graph Api | See node parameters |
| filter the image content-2 | Code | Code | See node parameters |
| Replicate params | Transform | Edit Fields | See node parameters |
| Generate image on flux | Web / API | HTTP Request | POST |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
facebookGraphApiopenAiApipostgrestelegramApi
Workflow notes
All Credentials You Need
All Credentials You Need
** Instagram Business Account Id ** Telegram Chat Id ** Rapid Api Key ** Replicate Token
Rapid Api params
test
Guide
Guide
** Guide of getting of Instagram Business Account Id
Guide
Guide
** Guide of Getting of Telegram Chat Id
Guide
Guide
** Guide of Getting of Rapid Api Key
Warning
Warning
**Don't forgot the create bot and send a message to bot first
Getting Top Trend Posts On Instagram
Getting Top Trend Posts On Instagram
** Change the topic you want to get on http request
Looping Data And Checking For Is Exist On Database
Looping Data And Checking For Is Exist On Database
**We are checking until find a data we did not insert because we don't want to create content about in same content
Analyze Post Content
Analyze Post Content
** We are analyzing the image ** We are generating a instagram caption by content ** Then we are generating the image
For More About Api
For More About Api
Guide
Guide
** Guide of getting of Replicate Token
For top_trends Table
For top_trends Table
CREATE TABLE top_trends (
id SERIAL PRIMARY KEY,
isposted BOOLEAN DEFAULT false,
createdat TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP,
updatedat TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP,
deletedat TIMESTAMP WITHOUT TIME ZONE,
prompt TEXT NOT NULL,
thumbnail_url TEXT,
code TEXT,
tag TEXT
);
Warning
Warning
** Don't forgot the create top_trends table
Automated Instagram Content Creation from Trending Posts
Automated Instagram Content Creation from Trending Posts
This workflow automates the process of discovering and recreating trending content on Instagram:
-
Content Discovery:
- Scrapes top trending posts from specific hashtags (#blender3d, #isometric)
- Filters for image-only content (excludes videos)
- Checks database to avoid duplicate content
-
AI-Powered Content Generation:
- Analyzes trending images using GPT-4 Vision
- Generates detailed descriptions of visual elements
- Creates engaging Instagram captions with relevant hashtags
- Uses Flux AI to generate similar but unique images
-
Publishing & Monitoring:
- Automatically posts content to Instagram Business Account
- Monitors post status and publishing process
- Sends status updates via Telegram
Perfect for content creators and businesses looking to maintain an active Instagram presence with AI-generated content inspired by current trends. The workflow runs on schedule and handles everything from content discovery to publication automatically.
Note: Requires Instagram Business Account, Telegram Bot, OpenAI, and Replicate API credentials.
Sticky Note15
##Warning ** Dont forgot the subscribe Instagram Scraper Api
Warning
Warning
** You can check the rate limit of the Instagram Scraper Api on Rapid Api ** Free version is monthly 500 request
Generate Instagram Content from Top Trends with AI Image Generation
Generate Instagram Content from Top Trends with AI Image Generation
Purpose and structure
This folder contains the Generate Instagram Content from Top Trends with AI Image Generation workflow. Its executable nodes use code, facebookGraphApi, httpRequest, if, merge, openAi, postgres, scheduleTrigger, set, splitInBatches, telegram. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
Schedule Trigger1
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Telegram/1482_Telegram_Code_Create_Webhook.json MIT; preserve source notices.
Canvas section labels
These name areas of the original canvas; they do not include explanatory instructions.
- Schedule Your Time To Post
- Publish On Instagram And Send Message When Published via Telegram