Automate Instagram content creation using this powerful n8n workflow. Scrape trending posts, leverage OpenAI and Replicate AI to generate unique images and engaging captions, and manage automated publishing.
Download this n8n workflow template and start using it instantly.
Maintaining a fresh and relevant social media presence requires constant trend monitoring and content creation. This advanced n8n workflow solves the tedious manual process by automating the discovery, generation, and publishing stages entirely. It uses RapidAPI to scrape top trending Instagram posts based on specific hashtags (like #blender3d and #isometric). After filtering and deduplicating content against a PostgreSQL database, the workflow leverages OpenAI's analysis capabilities to describe the image and generate high-quality, SEO-friendly captions. Crucially, it uses Replicate's Flux model to generate an entirely new, unique image based on the analyzed prompt, avoiding copyright issues while replicating the aesthetic trend. The final content is then automatically published to an Instagram Business Account, with all status updates monitored and reported via Telegram. This comprehensive n8n node sequence ensures continuous, automated, and trend-aware content delivery.
This n8n workflow executes on a predefined schedule (using the n8n trigger node) at 13:05 and 19:05 daily, ensuring timely content drops.
Set n8n nodes. It then uses the HTTP Request n8n node to query RapidAPI for top posts under specified hashtags. Code n8n nodes filter the scraped results to include only images and normalize the data fields (prompt, code, thumbnail URL). The results are combined using the Merge n8n node. Loop Over Items n8n node. A Postgres n8n node checks the database (top_trends table) for existing content codes. If the content is new, it proceeds; otherwise, the If Data is Exist n8n node skips the item.OpenAI (Langchain) n8n node analyzes the trend image thumbnail and generates a detailed description. A second OpenAI n8n node uses this description to generate an engaging Instagram caption complete with relevant hashtags. HTTP Request n8n node calls the Replicate API (Flux Schnell model) using the detailed AI description to generate a unique, stylized image, utilizing a Prefer: wait header for immediate results.Facebook Graph API n8n node prepares the media (image URL and caption) for upload. The n8n workflow then enters a monitoring loop: it checks the media status (Check Status Of Media Before Uploaded). If the status is FINISHED, the If media status is finished n8n node triggers the final publication. PUBLISHED, a success message is sent via a Telegram n8n node. Error paths throughout the n8n template ensure immediate Telegram notifications if database connection or media upload issues arise.To use this powerful n8n workflow, follow these steps:
toptrends table is created as specified in the sticky notes.Set n8n nodes with your specific IDs and keys:Replicate params: Input your replicatetoken.Instagram params: Input your instagrambusinessaccountid.Telegram Params: Input your telegramchat_id.Rapid Api params: Input your x-rapid-api-key (used for the Instagram Scraper). Schedule Trigger1 (n8n trigger): Initiates the flow based on a cron schedule (5 13,19 ), allowing for twice-daily execution of the entire n8n workflow.
HTTP Request (get trends): Uses the Instagram Scraper RapidAPI key to retrieve top trending posts for specific hashtags like #blender3d and #isometric.
Code (filter content): Filters the scraped results, ensuring only image posts are processed, and extracts key data points such as the prompt text and thumbnail URL.
Postgres (Check Data on Database Is Exist): This n8n node performs a lookup in the top_trends table to prevent publishing duplicate content, utilizing the content code as the unique identifier.
OpenAi (Analyze Image): An advanced LangChain n8n node using GPT-4o-mini to visually analyze the trending post's thumbnail URL and generate a detailed description, crucial for prompt engineering.
OpenAi (Generate Instagram Caption): Generates a concise, engaging Instagram caption (under 150 words) based on the image description, automatically including relevant hashtags. This is a key step in this n8n template.
HTTP Request (Generate image on flux): Calls the Replicate AI API to generate a new, unique image, based on the AI-generated detailed description, using the powerful Flux Schnell model.
Facebook Graph API (Prepare data on Instagram): Uploads the newly generated image and AI caption to Instagram's content queue, starting the publishing process within this robust n8n workflow.
If (If media status is finished): Controls the publishing flow, ensuring the media is ready before the final publication command is issued.
PUBLISHED by the final Check status of post n8n node.Generate highly relevant Instagram captions by analyzing recent post data for any hashtag using this advanced n8n workflow. Integrates Apify scraping with an OpenAI Agent (GPT-4o-mini) for structured content creation.

Automate social media content creation using this advanced n8n workflow. Generate cohesive AI influencer captions, structured image prompts, and video scripts based on your creative brief using GPT-4, then save results to Google Sheets.

Automate AI image generation using the vcollos/trefilio model on Replicate. This powerful n8n workflow template handles asynchronous polling and result extraction.

A sophisticated n8n workflow leveraging GPT and Gemini to generate unique daily inspirational quotes, captions, hashtags, and corresponding images, delivered via email for Instagram publishing.

Use this advanced n8n workflow to automate the extraction, transformation, and loading (ETL) of Revit model data. Calculate wall quantities and generate a stylish, interactive HTML report automatically.

Use this comprehensive n8n workflow to automate interior design conceptualization. Generate 12 detailed image prompts using an AI agent, create visuals via Hugging Face, and export a final two-page PDF moodboard, all driven by this powerful n8n automation.


Full-stack developer with 5+ years of experience in scalable software solutions. Skilled in Node.js, NestJS, PostgreSQL, and cloud platforms like AWS and Google Cloud. Expertise in microservices, real-time data processing, and API development. Passionate about delivering high-performance applications and driving innovation through cutting-edge technologies.







































