Get Started
Screenshot of n8n workflow
FREE TEMPLATE
Automate Instagram Trend Content Publishing
10
Views
0
Downloads
44
Nodes
Download Template
Free
Preview Template
Utility Rating
7 / 10
Business Function
Marketing
Automation Orchestrator
n8n
Integrations
Telegram
Replicate
RapidAPI Instagram Scraper API
PostgreSQL
OpenAI
Facebook Graph API
Trigger Type
Schedule
Approx setup time ≈ 75 min
Need help setting up this template?
Ask in our free Futurise community
About
Community
Courses
Events
Members
Templates

How to Automate Instagram Trend Content Publishing?

Leon Petrou
FREE TEMPLATE
Automate Instagram Trend Content Publishing
10
Views
0
Downloads
44
Nodes
Download Template
Free
Preview Template
Utility Rating
7 / 10
Business Function
Marketing
Automation Orchestrator
n8n
Integrations
Telegram
Replicate
RapidAPI Instagram Scraper API
PostgreSQL
OpenAI
Facebook Graph API
Trigger Type
Schedule
Approximate setup time ≈ 75 minutes
Need help setting up this template?
Ask in our free Futurise community

Description

Post fresh Instagram content from trending topics without manual work. Ideal for social media teams and creators who want steady posts based on what people are engaging with. You get scheduled posts, no duplicates, and instant status alerts in Telegram.

Twice a day a schedule runs, pulls top posts for two hashtags from a RapidAPI Instagram scraper, filters out videos, and merges results. Each item is checked against a PostgreSQL table to avoid reposting the same content. When a new item is found, OpenAI analyzes the image text to shape a caption, Replicate generates a matching image, and the Facebook Graph API prepares and publishes to your Instagram Business account. The workflow watches media status and sends Telegram messages for success or errors.

Setup needs an Instagram Business account, a Telegram bot and chat ID, a RapidAPI key, an OpenAI key, a Replicate token, and a reachable PostgreSQL database. Expect less time spent hunting for ideas and scheduling posts. This is useful for brands that post visual content and want a steady, trend led pipeline with AI help and clear alerts.

Copy link

Tools Required

Telegram
Sign up
Free: $0, Telegram Bot API usage is free for developers
Replicate
Sign up
Pay-as-you-go: $0 / mo; usage-based. Hardware from $0.000025/sec (CPU Small) and $0.000225/sec (Nvidia T4 GPU).
RapidAPI Instagram Scraper API
Sign up
PostgreSQL
Sign up
Free: $0 (open-source PostgreSQL License; self-hosted)
OpenAI
Sign up
Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens
n8n
Sign up
$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.
Facebook Graph API
Sign up
Free: $0 (no direct API charges; usage subject to rate limits)

What this workflow does?

  • Cron schedule runs at set times to drive reliable publishing
  • RapidAPI hashtag lookups for multiple topics with HTTP Request nodes
  • Image only filtering to skip videos and keep visuals consistent
  • Merge and batch logic to loop through many items safely
  • PostgreSQL deduplication to stop posting the same content twice
  • OpenAI analysis to shape content ideas and write Instagram captions
  • Replicate image generation to create a new on brand visual
  • Facebook Graph API steps to create media, poll status, and publish to Instagram
  • Telegram notifications for success and error events

What are the benefits?

  • Reduce manual trend research from hours to minutes by pulling hashtag leaders automatically twice per day
  • Eliminate repeat posts with a database check that skips content already used
  • Speed up creative work by using AI to draft captions and generate images
  • Improve posting consistency with a fixed schedule and status polling
  • Catch problems early with real time Telegram alerts for success and errors
  • Connect research, content creation, and publishing in one flow

How to set this up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Telegram, PostgreSQL, RapidAPI Instagram Scraper API, OpenAI, Replicate and Facebook Graph API. See the Tools Required section above for links to create accounts with these services.
  3. In the n8n credentials manager, connect Facebook Graph API. Double click the Instagram nodes, choose Create new credential, then follow the on screen steps. Make sure your Instagram account is a Business account linked to a Facebook Page.
  4. Set Instagram Business Account ID: open the Set node named Instagram params and paste your account ID into the instagram_business_account_id field.
  5. Connect Telegram: open any Telegram node, choose Create new credential, and follow the on screen steps. Create a bot and token, then ensure your bot can message the target chat.
  6. Set Telegram Chat ID: open the Set node named Telegram Params and paste your chat ID into the telegram_chat_id field. Send a test message to the bot first so the chat is active.
  7. Create a RapidAPI key in your RapidAPI dashboard and subscribe to the Instagram Scraper API plan you need. In the Set node Rapid Api params, paste the key into the x-rapid-api-key field.
  8. Connect OpenAI: double click the OpenAI nodes, choose Create new credential, and enter your OpenAI API key from the OpenAI account page.
  9. Connect Replicate: double click the Replicate nodes, choose Create new credential, and enter your Replicate API token. Also fill the Replicate params set node if present.
  10. Connect PostgreSQL in the credentials manager with your host, database, user, password, and SSL settings if required. Ensure a table exists to store used content IDs and set a unique index on that ID.
  11. Adjust schedule: open the Schedule Trigger node and update the cron expression if you want different times. The default runs at minute 5 of 13 and 19 server time.
  12. Test the flow: run once. Confirm RapidAPI requests return data, the filter keeps only images, the database stores a new ID, and a Telegram message appears on success. Check your Instagram account for a new post after the media status changes to finished.
  13. Troubleshoot: if publishing fails, verify Instagram Business permissions and Page link. If Telegram is silent, check the chat ID and the bot token. If RapidAPI calls fail, review your key and rate limits. If you see duplicates, confirm the database unique index and the query in the check node.

Need help or want to customize this?

Similar Templates

n8n
Marketing
Automate Instagram Comment Engagement
Turn Instagram comments into quick, human style replies powered by AI. This setup helps social media teams keep conversations going under posts without watching the feed all day. It is great for brands, creators, and agencies that want faster engagement. New comment events arrive through a secure webhook. A response step confirms the Meta handshake by echoing the challenge token. The flow then maps key fields, fetches the post caption from Instagram Graph, and checks that the comment did not come from the account owner. A Set step organizes user id, username, message id, message text, and media id. A Filter node named its me prevents self replies. A request to the Instagram Graph API v22.0 returns the caption for extra context. The AI Agent uses OpenRouter to write a friendly reply that fits an AI and automation profile. An HTTP call posts the response back under the original post. Setup needs an Instagram Graph access token, a verified webhook, and an OpenRouter API key. Expect shorter reply times, a steady brand tone, and the ability to handle a larger comment volume with the same team. Add this when you run launches, promotions, and posts where many people ask similar questions. In Meta App settings, use the same verify token as in n8n. Map fields to match your exact payload and adjust the prompt to your voice. Test with a real comment and fine tune phrasing as needed.
1 views
view
n8n
Marketing
Automate Instagram AI Trend Posting
Post fresh Instagram content on a set schedule without manual work. The system watches trending hashtags, turns ideas into an AI image and caption, and publishes from your business account. Teams that need steady social output and quick alerts will find it useful. Two daily runs start on a schedule. The flow gets top posts for chosen hashtags from RapidAPI, filters to image posts, and merges two feeds. A Postgres check prevents duplicates before anything moves forward. OpenAI writes the caption and Replicate renders the image. The Facebook Graph API creates and publishes the media after status checks, while Telegram sends success or failure alerts. Setup needs an Instagram Business account with Facebook Graph access, a PostgreSQL database, a RapidAPI key, a Replicate token, an OpenAI key, and a Telegram chat id. Expect daily content with less busy work, no repeat posts, and clear status updates. Good for social teams, creators, and small agencies that want reliable posting from real trends.
0 views
view
n8n
Marketing
Automate Instagram DMs for Lead Response
Turn Instagram direct messages into quick, helpful replies that match your brand voice. Ideal for creators, small shops, and marketing teams that get many DMs and need fast, consistent answers. Incoming messages arrive through a webhook from your messaging tool to n8n. A Set node holds the system prompt so the AI knows the tone and rules. The AI Agent uses a ChatGPT model and a local memory block that remembers the last 20 messages, so replies follow the same conversation. n8n then sends the answer back to your messaging tool using a response node, which delivers it to Instagram. You will need access to your messaging platform with a custom action or webhook, plus an OpenAI API key. Edit the prompt to fit your brand and adjust the memory window to control how much context the bot uses. Expect faster response times, more consistent replies, and the ability to handle high DM volume during launches or promos. Common uses include FAQ replies, simple sales questions, and first-touch lead qualification.
6 views
view
See More Templates

These templates were sourced from publicly available materials across the web, including n8n’s official website, YouTube and public GitHub repositories. We have consolidated and categorized them for easy search and filtering, and supplemented them with links to integrations, step-by-step setup instructions, and personalized support in the Futurise community. Content in this library is provided for education, evaluation and internal use. Users are responsible for checking and complying with the license terms with the author of the templates before commercial use or redistribution.Where an original author was identified, attribution has been provided. Some templates did not include author information. If you know who created this template, please let us know so we can add the appropriate credit and reference link. If you are the author and would like this template removed from the library, email us at info@futurise.com and we will remove it promptly.