Skip to content
MORNINGMETHOD
If media status i…If media status i…TelegramTelegram1Telegram2Loop Over ItemsSchedule Trigger1Telegram ParamsInstagram paramsRapid Api paramsfilter the image …get top trends on…get top trends on…merge the array c…Check Data on Dat…If Data is Existsend error messag…insert data on dbAnalyze Image and…Analyze Content A…Prepare data on I…Check Status Of M…Publish Media on …Check status of p…filter the image …Replicate paramsGenerate image on…
The workflow you get27 nodes
  • n8n
  • Telegram
  • HTTP Request
  • Postgres
  • OpenAI
  • Facebook Graph Api

Instagram Content from Trending Topics with AI Images

The AI finds what's trending and makes Instagram posts with pictures.

Best for: Instagram-first brands

$19.00Regular price $49.0061% off
  • Card or PayPal
  • Instant download
  • Setup guide included
Delivery
Download after payment
Format
n8n workflow + guide (ZIP)
Access
Re-download any time

Setup

What you need, and how to set it up

It runs by itself on a clock, like an alarm. No code needed. Follow the steps in order.

What you need

  • An n8n account

    The app that runs the automation.

    Free to self-host, or a free trial on n8n Cloud.

  • Telegram botFree

    Your own chat robot on Telegram.

    Get it: In Telegram, message @BotFather, type /newbot, pick a name, and copy the token it gives you. Show me how to connect Telegram bot (opens n8n docs)

    Used by: Telegram, Telegram1, Telegram2, send error message to tele

  • PostgreSQL databaseFree tier available

    A place where n8n keeps memory and data.

    Get it: Make a free database at supabase.com or neon.tech and copy its host, user and password. Show me how to connect PostgreSQL database (opens n8n docs)

    Used by: Check Data on Database Is , insert data on db

  • OpenAI API keyPay as you go, usually a few cents a day

    A secret password that lets n8n use ChatGPT's brain.

    Get it: Go to platform.openai.com, open API keys, and click Create new secret key. Copy it. Show me how to connect OpenAI API key (opens n8n docs)

    Used by: Analyze Image and give the, Analyze Content And Genera

  • Facebook / Instagram (Meta)Free

    Lets n8n post to your Facebook page or Instagram.

    Get it: Make a Meta developer app and create a page access token. Show me how to connect Facebook / Instagram (Meta) (opens n8n docs)

    Used by: Prepare data on Instagram, Check Status Of Media Befo, Publish Media on Instagram, Check status of post

Setup in 6 easy steps

  1. Step 1: Get n8n

    n8n is the app that runs your automation. Make a free account at n8n.io. That is the easy way. You can also put it on your own computer for free.

  2. Step 2: Download your file

    After you pay, open My downloads and download the ZIP. Double-click it to open it. Inside is a file called workflow.json.

  3. Step 3: Put it in n8n

    In n8n, click Create workflow. Click the three dots (⋯) at the top, then Import from file, and pick workflow.json. Now you see the same boxes as in the picture above.

  4. Step 4: Connect your accounts

    Some boxes show a little red triangle. That means they need a key. Click the box, click Create new credential, and paste the key from your list. Do this for each red box.

  5. Step 5: Try it once

    Click Test workflow. It runs right now instead of waiting for the clock. Green ticks on the boxes mean it worked.

  6. Step 6: Turn it on

    Click Save. Then flip the switch at the top from Inactive to Active. Now it works by itself, even while you sleep.

Stuck? Email support@morningmethod.co and we will help you.

Category: Automations › Social Media & Content · Best for: Instagram-first brands · Platform: n8n · Steps: 27

What it does

The AI finds what's trending and makes Instagram posts with pictures.

We are checking until find a data we did not insert because we don't want to create content about in same content

Works with: Postgres, Telegram, OpenAI, Facebook

What you get

  • The n8n workflow file (workflow.json), ready to import
  • This setup guide
  • The list of fields to change for your own accounts (see Install below)
  • Email support if you get stuck

Before you start

  1. An n8n account. Easiest: n8n Cloud (free trial). Self-host for free with Docker: docker run -it --rm -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n, then open http://localhost:5678.

  2. Accounts and API keys for these services:

    • Telegram bot token from @BotFather: how to connect (used by Telegram, Telegram1, Telegram2, send error message to telegram)
    • PostgreSQL database: how to connect (used by Check Data on Database Is Exist, insert data on db)
    • OpenAI API key: how to connect (used by Analyze Image and give the content, Analyze Content And Generate Instagram Caption)
    • Meta / Facebook Graph API: how to connect (used by Prepare data on Instagram, Check Status Of Media Before Uploaded, Publish Media on Instagram, **Check status of post **)

Install

  1. In n8n, click Create workflow (top right).
  2. Click the ⋯ menu → Import from file and choose workflow.json. Or open the file, copy everything and paste it onto the empty canvas with Ctrl/Cmd + V.
  3. Open each node with a red warning triangle and pick or create the matching credential from the list above.
  4. Point these fields at your own sheets, chats and accounts:
    • Telegram → chatId: choose your own
    • Telegram1 → chatId: choose your own
    • Telegram2 → chatId: choose your own
    • Check Data on Database Is Exist → table: choose your own
    • send error message to telegram → chatId: choose your own
    • insert data on db → table: choose your own
  5. Click Save.

Test it

  1. Click Test workflow (or Execute workflow). Schedule Trigger1 starts it. Trigger it once with real sample data.
  2. Click each node to check its output. A green tick means the step worked.
  3. Fix any red node: it's almost always a credential or a field that still points at a sheet or chat that isn't yours.

Go live

Toggle Active (top right). From now on it runs on its own. Check Executions in the left sidebar to see every run.

How it works, step by step

  1. Schedule Trigger1 starts the workflow (Schedule).
  2. Replicate params reshapes the data for the next step.
  3. Instagram params reshapes the data for the next step.
  4. Telegram Params reshapes the data for the next step.
  5. Rapid Api params reshapes the data for the next step.
  6. get top trends on instagram #isometric calls an external API (https://instagram-scraper-api2.p.rapidapi.com/v1/hashtag).
  7. get top trends on instagram #blender3d calls an external API (https://instagram-scraper-api2.p.rapidapi.com/v1/hashtag).
  8. filter the image content reshapes the data for the next step.
  9. filter the image content-2 reshapes the data for the next step.
  10. merge the array content uses Merge.
  11. Loop Over Items uses Split In Batches.
  12. Check Data on Database Is Exist uses Postgres to select.
  13. If Data is Exist checks a condition and routes items accordingly.
  14. send error message to telegram uses Telegram.
  15. insert data on db uses Postgres.
  16. Analyze Image and give the content uses AI (OpenAI).
  17. Analyze Content And Generate Instagram Caption uses AI (OpenAI).
  18. Generate image on flux calls an external API (https://api.replicate.com/v1/models/black-forest-labs/flux-s).
  19. Prepare data on Instagram uses Facebook.
  20. Check Status Of Media Before Uploaded uses Facebook.
  21. If media status is finished checks a condition and routes items accordingly.
  22. Publish Media on Instagram uses Facebook.
  23. Telegram uses Telegram.
  24. **Check status of post ** uses Facebook.
  25. If media status is finished1 checks a condition and routes items accordingly.
  26. Telegram1 uses Telegram.
  27. Telegram2 uses Telegram.

Extra setup notes

These notes are also on the canvas as yellow sticky notes:

All Credentials You Need

** Instagram Business Account Id ** Telegram Chat Id ** Rapid Api Key ** Replicate Token

Schedule Your Time To Post

Guide

** Guide of getting of Instagram Business Account Id

Guide

** Guide of Getting of Telegram Chat Id

Guide

** Guide of Getting of Rapid Api Key

Warning

**Don't forgot the create bot and send a message to bot first

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

**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

** We are analyzing the image ** We are generating a instagram caption by content ** Then we are generating the image

Publish On Instagram And Send Message When Published via Telegram

For More About Api

** Facebook Scraper Api Guide

Guide

** Guide of getting of Replicate Token

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

** Don't forgot the create top_trends table

Automated Instagram Content Creation from Trending Posts

This workflow automates the process of discovering and recreating trending content on Instagram:

  1. Content Discovery:
  • Scrapes top trending posts from specific hashtags (#blender3d, #isometric)
  • Filters for image-only content (excludes videos)
  • Checks database to avoid duplicate content
  1. 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
  1. 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.

##Warning

Warning

** You can check the rate limit of the Instagram Scraper Api on Rapid Api ** Free version is monthly 500 request

Troubleshooting

  • "Credentials not found": open the node and select your credential again.
  • Google "access blocked": in Google Cloud, add your email as a test user on the OAuth consent screen.
  • Webhook not firing: copy the node's Production URL (not Test URL) into the other app, and make sure the workflow is Active.
  • AI node errors: check your API key has billing enabled and the model name exists on your plan.
  • Nothing happens on schedule: the workflow must be Active, and self-hosted n8n must stay running.

Need help?

Reply to your Morning Method order email and we'll help you get it running.


© Morning Method

$19.00Regular price $49.0061% off
Instagram Content from Trending Topics with AI Images | n8n Automation | Morning Method