AI Meme Generator and Auto-Poster for Instagram - n8n Workflow

Automate viral content creation using this n8n workflow. It schedules an n8n trigger to generate memes via MagicHour AI, write captions with GPT-4o, and post them to Instagram via Late API.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Social Media Managers needing consistent, high-volume content.

  • Content Creators looking to automate meme generation and scheduling.

  • Marketers seeking effective n8n templates for engagement.

  • Users interested in combining multiple AI APIs (MagicHour, OpenAI, Late API) within one seamless n8n workflow.

Overview

Generating fresh, engaging content consistently is the biggest challenge for growing social media accounts. This advanced n8n workflow solves this by completely automating the content lifecycle for Instagram. By combining a recurring n8n trigger with specialized AI services, this template ensures your account posts viral-ready memes every 12 hours.

This robust n8n automation handles the meme generation using MagicHour AI, provides a crucial waiting period for processing, checks for successful generation, and then utilizes the OpenAI n8n node to craft compelling, hashtag-rich captions. Finally, it uses the Late API to schedule the finished post to Instagram, making this one of the most powerful content creation n8n templates available.

How it Works

The entire process is initiated by the ๐Ÿ“… Schedule Trigger n8n node, set to run every 12 hours.


  1. Generate Meme: The flow starts with an HTTP Request to the MagicHour AI API (๐ŸŽจ Generate Meme) to initiate the creation of a funny, relatable meme based on a provided topic prompt.

  2. Wait and Retrieve: The โณ Wait for Generation n8n node pauses the execution for 20 seconds, allowing the asynchronous image generation to complete. A subsequent HTTP Request (๐Ÿ–ผ๏ธ Get Generated Image) then retrieves the final URL of the high-resolution meme image.

  3. Validation: The โœ… Check Image Ready If n8n node validates that the image URL was successfully retrieved. If the generation failed, the workflow gracefully terminates using the โŒ Handle Generation Error node.

  4. Caption Generation: If successful, the flow moves to the ๐Ÿ“ Generate AI Caption n8n node (OpenAI). This node uses GPT-4o-mini to analyze the newly generated image and produce a viral Instagram caption, complete with relevant hashtags and a call-to-action.

  5. Posting and Scheduling: The ๐Ÿ“ฑ Post to Instagram HTTP Request node uses the Late API to schedule the final post. It combines the AI-generated caption and the meme image URL, setting the post time five minutes after the successful generation.

  6. Logging (Optional): The final ๐Ÿ“Š Log Success n8n node sends a notification or log entry confirming the successful completion of the automated posting cycle.

Installation Guide

To deploy this comprehensive n8n workflow, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON data and import it into your n8n instance via the 'Workflows' > 'New' > 'Import from JSON' option.

  2. Credential Setup: This n8n automation requires three main sets of credentials:

MagicHour API: Set up an HTTP Header Auth credential for MagicHour API keys.
OpenAI API: Set up an OpenAI credential for the ๐Ÿ“ Generate AI Caption n8n node.
* Late API: Set up an HTTP Header Auth credential for the Late API to handle Instagram scheduling.

  1. Customize Prompts: In the ๐ŸŽจ Generate Meme n8n node, update the style.topic field to align the meme content with your specific niche or brand.

  2. Set Account ID: In the ๐Ÿ“ฑ Post to Instagram n8n node JSON body, replace YOURINSTAGRAMACCOUNT_ID with the ID obtained from your Late API setup.

  3. Activate: Enable the ๐Ÿ“… Schedule Trigger n8n trigger and activate the workflow to begin automated content generation.

Node Details

๐Ÿ“… Schedule Trigger: The entry n8n node. It is configured to run this entire n8n workflow every 12 hours, ensuring constant content flow.
๐ŸŽจ Generate Meme (HTTP Request): Sends a POST request to MagicHour AI to start meme creation. Key configuration includes the API key authentication and the prompt detailing the desired viral meme style.
โณ Wait for Generation (Wait): A necessary flow control n8n node that pauses the execution for 20 seconds to wait for the asynchronous meme generation process to finalize.
๐Ÿ–ผ๏ธ Get Generated Image (HTTP Request): Retrieves the final image URL by dynamically using the project ID output from the ๐ŸŽจ Generate Meme n8n node.
โœ… Check Image Ready (If): Checks if the image retrieval was successful (i.e., if the downloads array contains an image URL). This prevents posting errors.
๐Ÿ“ Generate AI Caption (OpenAI n8n node): A specialized AI n8n node that uses gpt-4o-mini with vision capabilities. Its function is to analyze the generated image and write an engaging, hashtag-optimized Instagram caption.


  • ๐Ÿ“ฑ Post to Instagram (HTTP Request): Sends the finalized content (image URL and AI caption) to the Late API, scheduling the post for 5 minutes later. This is the final action of the n8n workflow.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by
Katie Allred
Katie Allred

Featured*