Skip to main content

Generate and publish carousels for TikTok and Instagram with GPT-Image-1

Workflow preview

Workflow preview
100%
Generate and publish carousels for TikTok and Instagram with GPT-Image-1 preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Description This n8n automation template provides an end to end solution for generating a series of themed images for Instagram and TikTok carousels using OpenAI's GPT Image (via the image generati...

Best for

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

Tools used

n8n-nodes-base.code, n8n-nodes-base.httprequest, n8n-nodes-base.merge, n8n-nodes-base.manualtrigger, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.set, n8n-nodes-base.splitout, n8n-nodes-base.converttofile

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Juan Carlos Cavero Gracia.

Original n8n.io source

1.1 Workflow description

Title
Generate and publish carousels for TikTok and Instagram with GPT-Image-1
Workflow name
Generate and publish carousels for TikTok and Instagram with GPT-Image-1

Description

This n8n automation template provides an end-to-end solution for generating a series of themed images for Instagram and TikTok carousels using OpenAI's GPT Image (via the image generation API) and automatically publishing them to both platforms. It uses a sequence of prompts to create a narrative or themed carousel, generating each image based on the previous one, and then posts them with an AI-generated caption.

Who Is This For?

  • Social Media Managers: Quickly create and schedule engaging image carousels for Instagram and TikTok.
  • Content Creators: Automate the visual content creation process for thematic posts or storytelling carousels.
  • Digital Marketers: Efficiently produce visual assets for campaigns that require sequential imagery.
  • Small Businesses: Generate unique promotional content for social media without needing advanced design skills.

What Problem Does This Workflow Solve?

Manually creating a series of related images for a carousel and then publishing them across multiple platforms can be repetitive and time-consuming. This workflow addresses these issues by:

  • Automating Image Generation: Uses OpenAI to generate a sequence of 5 images, where each new image is an evolution based on the previous one and a new prompt.
  • Automating Caption Generation: Leverages OpenAI (GPT) to create a suitable description/caption for the carousel based on the image prompts.
  • Streamlining Multi-Platform Publishing: Automatically uploads the generated image carousel and caption to both Instagram and TikTok.
  • Reducing Manual Effort: Significantly cuts down the time spent on designing individual images and manually uploading them.
  • Ensuring Visual Cohesion: The sequential image generation method (editing the previous image) helps maintain a consistent style or narrative across the carousel.

How It Works

  1. Trigger: The workflow is initiated manually (can be adapted to a schedule or webhook).
  2. Define Prompts: Five distinct prompts are pre-set within the workflow to guide the generation of each image in the carousel.
  3. AI Caption Generation: OpenAI (GPT-4.1) generates a concise (≤ 90 characters for TikTok) description for the social media posts based on all five image prompts.
  4. Sequential AI Image Generation:
    • Image 1: OpenAI's image generation API (specified as gpt-image-1) creates the first image based on prompt1.
    • Image 2-5: For each subsequent image, the workflow uses the OpenAI image edits API. It takes the previously generated image and a new prompt (prompt2 for image 2, prompt3 for image 3, and so on) to create the next image in the sequence.
    • Images are converted from base64 JSON to binary format.
  5. Content Aggregation: The five generated binary image files (named photo1 through photo5) are merged.
  6. Multi-Platform Distribution:
    • The merged images and the AI-generated description are sent to api.upload-post.com for publishing as a carousel to Instagram.
    • The same content is sent to api.upload-post.com for publishing as a carousel to TikTok, with an option to automatically add music.
    • The TikTok description is truncated if it exceeds 90 characters.

Setup

  1. Accounts & API Keys: You will need:
  2. Configure Credentials:
    • Add your OpenAI API key to the "OpenAI" credentials in n8n. This will be used by the "Generate Description for Tiktok and Instagram" node and the HTTP Request nodes calling the OpenAI image generation/edit APIs.
    • In the "POST TO INSTAGRAM" and "POST TO TIKTOK" nodes, replace "Apikey add_api_key_here" with your actual upload-post.com API key.
    • Update the user field in the "POST TO INSTAGRAM" and "POST TO TIKTOK" nodes if "upload_post" is not your user identifier for that service.
  3. Customize Prompts: Modify the five prompts (prompt1 to prompt5) in the "Set All Prompts" node to define the story or theme of your image carousel.
  4. Review Image Generation Parameters: In the "Set API Variables" node, you can adjust:
    • size_of_image (e.g., "1024x1536" for vertical carousels).
    • openai_image_model (ensure this matches a valid OpenAI model identifier for image generation/edits, like dall-e-2 or dall-e-3 if gpt-image-1 is a placeholder).
    • response_format_image (should generally remain b64_json for this workflow).
  5. (Optional) TikTok Auto Music: The "POST TO TIKTOK" node has an auto_add_music parameter set to true. Change this to false if you prefer to add music manually or not at all.

Requirements

  • Accounts: n8n, OpenAI, upload-post.com.
  • API Keys & Credentials: API Keys for OpenAI and https://upload-post.com.
  • (Potentially) Paid Plans: OpenAI and upload-post.com usage may incur costs depending on your volume and their respective pricing models.

This template empowers you to automate the creation and distribution of visually consistent image carousels, saving time and enhancing your social media presence.

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 - Send as 1 merged file

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

Block 2 - POST TO INSTAGRAM

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 3 - Merge

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

Block 4 - When clicking ‘Test workflow’

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

Block 5 - Generate Description for Tiktok and Instagram

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.4

Block 6 - Set All Prompts

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 7 - Set API Variables

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 8 - OpenAI - Generate Image 1

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 9 - Separate Image Outputs 1

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

Block 10 - Convert to File 1

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

Block 11 - Change name to photo1

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

Block 12 - OpenAI - Generate Image 2

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 13 - Separate Image Outputs 2

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

Block 14 - Convert to File 2

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

Block 15 - Change name to photo2

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

Block 16 - OpenAI - Generate Image 3

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 17 - Separate Image Outputs 3

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

Block 18 - Convert to File 3

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

Block 19 - Change name to photo3

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

Block 20 - OpenAI - Generate Image 4

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 21 - Separate Image Outputs 4

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

Block 22 - Convert to File 4

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

Block 23 - Change name to photo4

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

Block 24 - OpenAI - Generate Image 5

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Showing the first 24 of 28 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Generate and publish carousels for TikTok and Instagram with GPT-Image-1
Complexity advanced
Nodes 28
Categories Content Creation, Multimodal AI
Author Juan Carlos Cavero Gracia
Published 13 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4028/4028.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 Generate and publish carousels for TikTok and Instagram with GPT-Image-1 do?

Description This n8n automation template provides an end to end solution for generating a series of themed images for Instagram and TikTok carousels using OpenAI's GPT Image (via the image generati...

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.