Automate Instagram Content Creation with n8n & AI

Discover how this n8n workflow automates Instagram content creation by scraping top trends, generating AI-enhanced images and captions, and posting seamlessly. Save hours weekly while maintaining fresh, unique posts inspired by trending hashtags.
if
telegram
splitInBatches
+9
Workflow Identifier: 1262
NODES in Use: If, Telegram, SplitInBatches, ScheduleTrigger, Set, HttpRequest, Code, Merge, Postgres, FacebookGraphApi, OpenAI, StickyNote

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Workflow Does ⚙️

This workflow runs twice a day to find popular Instagram posts under hashtags like #blender3d and #isometric.
It picks images only, not videos, and skips repeated content using a database check.
Then AI explains what the image shows and writes a catchy caption.
It also makes a similar but new image in a 3D toy style using AI.
Finally, it posts the new image and caption to an Instagram Business Account automatically.

The workflow sends messages by Telegram for status or errors.


Tools and Services Used

  • n8n: Automates the workflow with scheduling and API calls.
  • Instagram Business Account: Receives the final posts via Facebook Graph API.
  • Telegram Bot API: Sends progress and error updates.
  • OpenAI GPT-4 Vision API: Analyzes images and generates captions.
  • Replicate API with Flux AI: Creates new AI images based on prompts.
  • RapidAPI Instagram Scraper: Gets trending Instagram posts by hashtag.
  • PostgreSQL Database: Stores posts info to prevent duplicates.

How the Workflow Works (Input → Process → Output)

Input:

  • Scheduled trigger at 1:05 PM and 7:05 PM Istanbul Time.
  • Hashtags to search: #blender3d and #isometric.
  • API keys and IDs for Instagram, Telegram, OpenAI, Replicate, RapidAPI, and PostgreSQL.

Processing Steps:

  • Scrape top posts on Instagram by each hashtag.
  • Filter out videos, keep only image posts.
  • Merge results from both hashtags into one list.
  • Loop through each post to check if it exists in the PostgreSQL database.
  • Add new posts to the database if not found, marking them as unposted.
  • Analyze each new image with OpenAI GPT-4 Vision to describe it.
  • Generate Instagram caption using OpenAI with relevant hashtags.
  • Use Replicate API (Flux AI) to make a unique 3D isometric style image based on the description.
  • Upload the AI-generated image and caption to Instagram Business Account as unpublished media.
  • Check upload status until it shows as “FINISHED”.
  • Publish the media on Instagram when ready.
  • Send Telegram notifications for progress, success, or errors.

Output:

  • New, unique Instagram posts with AI-generated images and captions.
  • Real-time Telegram updates about posting status.

Who Should Use This Workflow

This workflow is good for digital artists, content creators, and social media managers.
If you spend hours each week hunting for trendy Instagram content and want to save time, this helps.
It works well if you have an Instagram Business Account and want fresh, eye-catching posts without repeating old ones.

It also suits users familiar with connecting APIs and databases but prefer an easy way to post automatically.


Beginner Step-by-Step: How to Activate This Workflow in n8n

Step 1: Import the Workflow

  1. Download the workflow file from this page.
  2. Open your n8n editor.
  3. Use the Import from File feature to upload the workflow.

Step 2: Add Your Credentials

  1. Locate Instagram params node and enter your Instagram Business Account ID.
  2. Fill Telegram Params with your Telegram Bot API chat ID.
  3. Update Rapid Api params with your RapidAPI key for Instagram Scraper.
  4. Add your OpenAI API key in the relevant nodes for image analysis and captioning.
  5. Put your Replicate API token in the Replicate params node.
  6. Check your PostgreSQL database connection and table setup (table named top_trends).

Step 3: Customize IDs or Details if Needed

  1. Change hashtags queried in the get top trends on instagram #blender3d and get top trends on instagram #isometric nodes if desired.
  2. Check any other IDs or tokens in Set nodes and update.

Step 4: Test the Workflow

  1. Run the workflow once manually inside n8n.
  2. Verify if steps pass without errors.
  3. Check Telegram for any status messages.

Step 5: Turn the Workflow On

  1. Activate the workflow by toggling it to “active” in the editor.
  2. It will now run automatically at scheduled times.

If using self-host n8n, see self-host n8n to optimize server performance.


Customization Ideas

  • Change hashtags in the two Instagram Scraper nodes to suit a different niche.
  • Edit the prompt in Analyze Content And Generate Instagram Caption node to adjust caption tone or tags.
  • Modify the JSON body of Generate image on flux to try different image styles or resolutions.
  • Adjust scheduled times in Schedule Trigger if a different posting window works better.
  • Add extra columns to PostgreSQL table top_trends for tracking likes or original post link.

Common Problems and Solutions

  • Instagram Scraper API no data: Key expired or quota used up. Renew RapidAPI subscription.
  • OpenAI failures: Wrong API key or usage limits hit. Check OpenAI account and key status.
  • Instagram post not finishing upload: Permissions or network issues. Check Facebook Graph API access and retry.
  • Telegram messages missing: Bot not started by messaging or wrong chat ID. Send /start and verify chat ID.

Pre-Production Checklist ✅

  • Confirm Instagram Business Account ID and Facebook Graph API keys are valid.
  • Verify Telegram Bot is active, sent /start and chat ID correct.
  • Check RapidAPI Instagram Scraper subscription and keys.
  • Test OpenAI and Replicate API keys with sample requests.
  • Ensure PostgreSQL table top_trends exists with proper schema.
  • Run the workflow manually to confirm no errors before scheduling.

Summary

→ Finds trending Instagram images twice a day under chosen hashtags.
→ Checks database to avoid reposting duplicate content.
→ Uses AI to analyze images and write good captions.
→ Creates new AI-generated 3D style images for posts.
→ Automatically uploads and publishes to Instagram Business Account.
→ Sends Telegram messages to keep updated about progress.
→ Saves over 8 hours weekly by removing manual searching and posting.


Frequently Asked Questions

Yes. Replace the HTTP Request node named Generate image on flux with another API call. Adjust the request body as needed for the new service.
Lower how often the workflow runs or reduce the number of posts scraped per run. Monitor API usage on dashboards regularly.
Check Facebook Graph API permissions and ensure the Instagram Business Account is properly linked. Retry uploading media if network issues occur.
Make sure the Telegram Bot was started by sending a message. Verify the chat ID matches the one used in the Telegram Params node.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free