Skip to main content

Create Instagram carousel posts using GPT-4.1 Nano and Gemini 2.5 Flash

Workflow preview

Workflow preview
100%
Create Instagram carousel posts using GPT-4.1 Nano and Gemini 2.5 Flash preview
Open on n8n.io

1. Workflow Overview

Tired of manually creating Instagram carousel content? This workflow takes a single content idea from a database, uses GPT 4.1 Nano + Gemini 2.5 Flash to generate unique images and captions, upload...

Best for

  • Content Creation automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.datatable, @n8n/n8n-nodes-langchain.googlegemini, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.manualtrigger, n8n-nodes-uploadtourl.uploadtourl, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.code, n8n-nodes-base.splitinbatches

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Jitesh Dugar.

Original n8n.io source

1.1 Workflow description

Title
Create Instagram carousel posts using GPT-4.1 Nano and Gemini 2.5 Flash
Workflow name
Create Instagram carousel posts using GPT-4.1 Nano and Gemini 2.5 Flash

Tired of manually creating Instagram carousel content? This workflow takes a single content idea from a database, uses GPT-4.1 Nano + Gemini 2.5 Flash to generate unique images and captions, uploads them, and publishes a fully formatted Instagram carousel β€” all without touching your phone.


🧠 How It Works

Feed it a topic. It does the rest.


πŸ” Workflow Breakdown

1. ▢️ Manual Trigger β€” When clicking 'Execute workflow'

Kicks off the workflow on demand. Swap this with a Schedule Trigger or Webhook to make it fully hands-free and time-based.


2. πŸ“‹ Get Row(s) β€” Data Table (Get)

Fetches the next unprocessed content idea from an n8n Data Table. It filters rows where the status column is empty, ensuring only fresh, unpublished ideas are picked up. Each row contains:

  • prompt β€” the core content concept
  • number_of_images β€” how many carousel slides to generate

3. 🧩 OpenAI Chat Model β€” GPT-4.1 Nano

Acts as the language model backbone for the prompt engineering agent. Connected to the Generate-Prompt agent as its AI brain, it powers all text reasoning and JSON output generation.


4. ✍️ Generate-Prompt β€” LangChain AI Agent

An expert prompt engineering agent powered by GPT-4.1 Nano. It takes the core idea and produces a structured JSON array containing:

  • image_prompt β€” a richly detailed, unique visual prompt per slide (varied angles, styles, lighting)
  • caption β€” a short Instagram caption per slide

It outputs N distinct prompts based on the number_of_images field.


5. πŸ”„ Parse_Array β€” Code Node

Parses the agent's raw JSON string output into proper n8n items, one per image prompt. This allows the loop below to process each prompt individually. Without this step, the array would remain a single unprocessed string.


6. πŸ” Loop For Each Prompt β€” Split In Batches

Iterates over each image prompt one at a time. On the final iteration, it routes to the Collect Image URLs node to assemble everything. On every other pass, it routes to Generate an image to keep generating.


7. 🎨 Generate an Image β€” Google Gemini 2.5 Flash Image

Uses Gemini 2.5 Flash Image (Nano Banana) to generate a high-quality image for each prompt. The detailed prompt from the agent is passed directly here, ensuring each carousel slide is visually distinct from the others.


8. ☁️ Upload a File β€” Upload To URL

Takes the generated binary image and uploads it to a publicly accessible URL via the uploadtourl service. Instagram requires all carousel images to be hosted at public URLs before publishing β€” this node handles that requirement.

πŸ”‘ Get your free API key here: uploadtourl.com


9. ⏱️ Rate Control β€” Code Node

Two critical jobs in one node:

  1. Accumulates the uploaded image URL into global workflow static data so URLs persist across loop iterations.
  2. Waits 15 seconds between iterations to respect Instagram and image generation API rate limits, preventing failures during bulk runs.

10. πŸ“¦ Collect Image URLs β€” Code Node

After the loop completes, this node retrieves all accumulated image URLs from global static data, resets the store for the next run, and bundles everything into a single object:

  • image_urls β€” array of all carousel image URLs
  • caption β€” pulled from the first generated item

This is the final assembly step before publishing.


11. πŸ“Έ Publish on Instagram β€” Instagram Node

Publishes the full carousel post to Instagram using the Facebook Graph API. It sends all image URLs in one request along with the AI-generated caption. Targets a specific Instagram Business Account by node ID.


12. βœ… Update Row(s) β€” Data Table (Update)

After successful publishing, marks the row in the Data Table as Published, writing in the returned post ID. This prevents the same idea from being posted twice and keeps your content queue clean and trackable.


πŸ› οΈ Tech Stack

  • n8n β€” Workflow automation
  • OpenAI GPT-4.1 Nano β€” Prompt generation
  • Google Gemini 2.5 Flash Image β€” AI image generation
  • UploadToURL β€” Image hosting
  • Instagram Graph API β€” Carousel publishing
  • n8n Data Table β€” Content queue & status tracking

βš™οΈ Setup Requirements

  • OpenAI API key
  • Google Gemini (PaLM) API key
  • UploadToURL account
  • Instagram Business Account connected via Facebook Graph API
  • n8n Data Table with columns: prompt, number_of_images, status

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Get row(s)

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1.1

Block 2 - Generate an image

Type / Role
@n8n/n8n-nodes-langchain.googleGemini - googleGemini
Config choices
Version 1.1

Block 3 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.3

Block 4 - When clicking β€˜Execute workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 5 - Upload a File

Type / Role
n8n-nodes-uploadtourl.uploadToUrl - uploadToUrl
Config choices
Version 1

Block 6 - Generate-Prompt

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3.1

Block 7 - Parse_Array

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Loop For Each Prompt

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 9 - Publish on Instagram

Type / Role
@mookielianhd/n8n-nodes-instagram.instagram - instagram
Config choices
Version 1

Block 10 - Update row(s)

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1.1

Block 11 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Collect Image URLs

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 16 - Rate Control

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 17 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Create Instagram carousel posts using GPT-4.1 Nano and Gemini 2.5 Flash
Complexity advanced
Nodes 21
Categories Content Creation, Multimodal AI
Author Jitesh Dugar
Published 25 Apr 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15284/15284.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Create Instagram carousel posts using GPT-4.1 Nano and Gemini 2.5 Flash do?

Tired of manually creating Instagram carousel content? This workflow takes a single content idea from a database, uses GPT 4.1 Nano + Gemini 2.5 Flash to generate unique images and captions, upload...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Content Creation, Multimodal AI use case.