Automate Instagram Content Creation with n8n and Google Gemini

Discover how this n8n workflow automates Instagram content creation by generating unique post concepts, AI-driven images, and tailored captions based on your Google Sheets content plan. Save hours weekly by automating your social media strategy with AI-powered creativity.
googleSheets
chainLlm
facebookGraphApi
+7
Workflow Identifier: 1236
NODES in Use: Schedule Trigger, Google Sheets, Set, Langchain Chain LLM, Langchain LLM Chat Google Gemini, Langchain Output Parser Structured, HTTP Request, Facebook Graph API, Wait, Sticky Note
Automate Instagram content with n8n and Google Gemini

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

Learn how to Build this Workflow with AI:

What This Automation Does

This n8n workflow helps automate Instagram content creation.
It solves the problem of spending many hours manually making posts and captions.
The workflow creates unique Instagram posts with AI images and captions, then publishes automatically.

You get fresh, brand-friendly posts with less work and fewer mistakes.


How the Workflow Works: Inputs, Processing, Outputs

Inputs

  • Post ideas from Google Sheets with columns: Topic, Audience, Voice, Platform, Status (0 means ready).
  • Google Gemini AI to create text concepts and captions.
  • Replicate Flux AI to make Instagram-style images.
  • Instagram Business account connected via Facebook Graph API.

Processing Steps

  • The workflow checks Google Sheets for the next post idea (Status = 0).
  • Extracts important info (Topic, Audience, Brand Voice, Platform).
  • Uses Google Gemini AI to create one unique content concept for Instagram focusing on a single image post.
  • Generates two detailed options for AI image prompts to get different visual styles.
  • Creates a concise Instagram caption with hashtags based on concept and audience.
  • Sends the chosen image prompt to Replicate Flux API to generate the image.
  • Uploads the created image and caption using Instagram’s Graph API.
  • Waits briefly to allow Instagram to process the upload.
  • Publishes the post on Instagram.
  • Marks the original Google Sheets row as completed (Status = 1) to avoid reposts.

Outputs

  • A new Instagram photo post with AI-generated image and caption matching the brand voice.
  • Google Sheets updated to show post was published.

Who Should Use This Workflow

This workflow fits social media managers and small marketing teams.
Users who want to save time creating branded Instagram content will benefit.
It helps avoid missed post deadlines and keeps messaging steady.
This also works for people with little design skills because AI generates images.


Tools and Services Used

  • n8n automation platform: Runs the workflow and connects services.
  • Google Sheets API: Stores and tracks post ideas and status.
  • Google Gemini AI: Writes unique content concepts and captions.
  • Replicate Flux AI model: Generates Instagram-style images from prompts.
  • Facebook Graph API: Uploads and publishes posts to Instagram Business accounts.

Beginner Step-By-Step: How to Use This Workflow in n8n

Step 1: Import the Workflow

  1. Click the Download button on this page to get the workflow file.
  2. Open the n8n editor where you want to run the workflow.
  3. Use the top menu, select Import from File, and choose the downloaded workflow file.

Step 2: Set Up Credentials and IDs

  1. Add required API Keys and OAuth2 credentials for Google Sheets, Google Gemini, Replicate, and Facebook Graph API.
  2. Update any spreadsheet IDs, sheet names, or Instagram Business account IDs if different from defaults.
  3. Make sure your Google Sheet has columns: Topic, Audience, Voice, Platform, and Status.
  4. Check the workflow nodes that use Code or Prompts to ensure they contain the exact text or expressions provided.

Step 3: Test the Workflow

  1. Run the workflow manually once inside n8n to check it works without errors.
  2. Verify a post is created on Instagram and the Google Sheet updates the Status column.

Step 4: Activate for Production

  1. Turn on the workflow to run on the schedule set in the Schedule Trigger node.
  2. Monitor executions in n8n to catch any errors early.
  3. Optionally, visit self-host n8n if full control or scalability is needed.

Customizations and Tips

  • Change the Platform column in Google Sheets to switch between Instagram and LinkedIn.
  • Use the second image prompt option by updating the HTTP Request node to try different image styles.
  • Adjust the schedule trigger interval to post more or less often.
  • Change the caption style by editing the prompt text in the Chain LLM caption generation node.
  • Add support for more platforms by extending the workflow and API calls.

Common Issues and How to Fix Them

Google Sheets node returns no rows: Check that your filter for Status = 0 matches your sheet data exactly. Make sure your OAuth2 credentials have access and the sheet is shared properly.

Replicate API call fails: Verify the API Key is correctly set in headers. Avoid sending many requests quickly. Confirm prompt text is valid JSON.

Instagram media upload or post not showing: Confirm Facebook Graph API version matches with your Instagram Business account setup. Verify all permissions for media publishing are granted.


Pre-Production Checklist

  • Google Sheet has post ideas marked as Status = 0.
  • Tested Google Sheets nodes can read and change rows.
  • Google Gemini API keys work and generate content and captions.
  • Replicate API creates images correctly from sample prompts.
  • Facebook Graph API connected to Instagram Business account.
  • Workflow tested manually without errors.
  • Google Sheet backed up regularly.

Summary of Results

✓ Saves several hours per Instagram post creation.
✓ Reduces manual errors and missed posts.
✓ Creates unique AI-generated images and captions matching your brand voice.
✓ Publishes directly to Instagram Business without extra steps.
✓ Keeps Google Sheets updated to track published content.


Automate Instagram content with n8n and Google Gemini

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The workflow searches the Google Sheets for rows where the Status column equals 0, indicating the idea is ready to process.
Google Gemini AI generates the content concept and captions, while the Replicate Flux model creates AI-based Instagram-style images.
The workflow uses the Facebook Graph API to upload the image and caption as media, waits for processing, then publishes the post to the connected Instagram Business account.
Yes, by changing the Platform field in Google Sheets and updating AI prompt content, the workflow can target other platforms like LinkedIn with adaptations.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.