AI Image Editing, Airtable Sync, and Instagram Publishing - n8n Workflow

Use this powerful n8n workflow to analyze base images with GPT-4 Vision, generate optimized content via Gemini, sync with Airtable, and automatically post the final image to Instagram. Perfect n8n templates for marketers.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Digital Marketing Agencies: Users needing scalable, automated social media content pipelines. Content Managers: Individuals managing Instagram accounts who want to automate image editing and scheduling based on database inputs. n8n Automation Engineers: Developers seeking advanced n8n templates combining external AI services (OpenAI, Gemini) with database (Airtable) and social media (Instagram) platforms. Data-Driven Creators: Anyone using Airtable as a master content planner and needing an automated n8n trigger to initiate complex creative tasks.

Overview

Scaling high-quality, customized social media content can be resource-intensive, often requiring manual handoffs between database management, creative teams, and scheduling tools. This sophisticated n8n workflow solves this inefficiency by creating a fully autonomous content production machine. The automation starts with an n8n trigger from Airtable, pulls an existing base image, uses GPT-4 Vision to deconstruct its exact style and structure, and then feeds this analysis along with new editing specifications into Gemini. The result is a highly specific, AI-edited image, which is then uploaded back to Airtable and immediately published to Instagram. This specific n8n workflow is one of the most powerful n8n templates for advanced creative automation.

How it Works

This comprehensive n8n workflow operates in a precise sequence, initiated by a webhook n8n trigger.


  1. Trigger & Retrieval: The process begins when an external system (likely an Airtable automation) calls the Webhook n8n trigger, providing the recordId of the row needing processing. The Get Image n8n node fetches the base image from that specific Airtable record.

  2. Visual Analysis (GPT-4 Vision): The Analyze image n8n node utilizes GPT-4o-mini's vision capabilities. It deconstructs the image into detailed elements: Core Subject, Lighting, Composition, Style, and Text Overlay. This crucial output serves as the 'DNA' of the original image.

  3. Modification Input: The Get Rows n8n node retrieves the editing specifications (e.g., 'Post Description', 'New Style') needed for the final output.

  4. Prompt Optimization: The Prompt Optimization n8n node (a Langchain Chain) combines the visual analysis output (the 'DNA') with the user-defined editing specifications from Airtable. It generates a highly optimized, cohesive image modification prompt for the subsequent AI generation step. This is a key step in this n8n workflow.

  5. AI Image Editing (Gemini): The Nano Bannana Image Generation n8n node sends the base image URL and the refined prompt to the Gemini API. This performs the AI-powered editing, producing the final Instagram-ready asset. This n8n node includes error handling.

  6. Data Synchronization & Publishing: The workflow proceeds along two parallel paths upon successful image generation:

Airtable Update: The Airtable Upload n8n node sends the newly generated image URL back to the original Airtable record.
Instagram Posting: The Create Media Container and Publish Media n8n nodes interact with the Instagram Graph API, staging the image and associated caption, and then publishing the final post.

  1. Completion Status: Finally, the Status Complete n8n node updates the Airtable record, marking the entire process as 'Completed'. If the Gemini step fails, the Status Error n8n node logs the error code back into Airtable, completing the error handling branch of the n8n workflow.

Installation Guide

To deploy this powerful n8n workflow template, follow these steps:


  1. Import the JSON: Copy the provided n8n workflow JSON code and paste it into your n8n instance's workflow designer (New > Import from JSON).

  2. Set up Credentials: You will need to configure the following credentials for the n8n nodes:

Airtable Personal Access Token: Required for the Airtable nodes (Get Image, Get Rows, Status Complete, Status Error) and the Airtable Upload HTTP Request. Ensure this token has read/write access to your designated content base.
OpenAI API Key: Required for the Analyze image n8n node (GPT-4o-mini Vision).
* Gemini nano API Key: Required for the Nano Bannana Image Generation n8n node.

  1. Configure Webhook: Activate the Webhook n8n trigger. Copy the unique URL to be used in your Airtable automation (or other triggering mechanism). Ensure your external trigger includes the recordId in the query parameters.

  2. Instagram API Configuration: In the Create Media Container and Publish Media n8n nodes, replace the placeholders {instagram-business-account-id} and METAACCESSTOKEN with your actual Instagram Business Account ID and Meta Access Token.

  3. Airtable Base Configuration: Verify that the 'Base' and 'Table' selections in all Airtable n8n nodes match your specific Airtable setup.

Node Details

This n8n workflow leverages several specialized n8n node types for its functionality:

Webhook (n8n trigger): The entry point for the n8n workflow.
Function: Listens for external API calls, typically from an Airtable automation, to start processing a specific record.
Key Configuration: Receives the recordId via query parameter to identify the target image record.
Airtable (Get Image, Get Rows, Status Update n8n node): Essential for database interaction.
Function: Used to retrieve the initial image data and the desired modification specifications (Style, Composition, etc.). Also crucial for updating the record status to 'Completed' or 'Error'.
Key Configuration: Uses specific Base IDs and Table names, filters rows by {Status} = "Create" (in Get Rows), and uses the ID to match and update records.
OpenAI (Analyze image n8n node): GPT-4 Vision integration.
Function: Analyzes the base image using a comprehensive prompt to deconstruct its visual elements, providing structured metadata (e.g., Lighting, Mood, Style).
Key Configuration: Uses the gpt-4o-mini model for image analysis; inputs the image URL dynamically from the Airtable record.
Langchain Chain (Prompt Optimization n8n node): A powerful processing n8n node.
Function: Acts as an LLM orchestrator, taking the GPT-4 Vision output and the desired Airtable changes to construct a final, highly specific editing prompt required by the Gemini image model.
HTTP Request (Nano Bannana Image Generation n8n node): Gemini API integration.
Function: Sends the base image (as inline data) and the optimized prompt to the Gemini 2.0-flash model to generate the edited image. Handles error continuation.
HTTP Request (Airtable Upload, Create Media Container, Publish Media n8n node):
Function:* Handles crucial external communications: uploading the generated image file back to Airtable, and executing the multi-step process required to publish the content via the Instagram Graph API.

Related n8n Workflows

Free

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

Featured*