Automated Instagram Posting with Google Drive, AI Captions, and Facebook API - n8n Workflow

Streamline content management with this robust n8n workflow. Trigger posts via Google Drive upload, instantly generate optimized captions using OpenAI, log details to Google Sheets, and publish directly to Instagram using the Facebook Graph API n8n node.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Social Media Managers and Agencies looking for efficient content scheduling and posting solutions.

  • Content Creators who need to automate their publishing pipeline from file storage to social media.

  • Users searching for advanced n8n templates that integrate AI models (OpenAI) with major social platforms.

  • Teams utilizing n8n to integrate Google Workspace (Drive, Sheets) with the Facebook Graph API.

Overview

Managing high volumes of social media content can be time-consuming, requiring manual effort to move files, craft captions, and schedule posts. This powerful n8n automation solves this bottleneck by creating a hands-off publishing pipeline. By simply dropping a video or image file into a designated Google Drive folder, the entire n8n workflow is initiated. The file is processed, an engaging caption is generated by OpenAI, all data is logged in Google Sheets for record-keeping, and the final media is published to Instagram using the Facebook Graph API n8n node. This approach not only saves significant time but also ensures consistent, SEO-optimized content creation through the use of an advanced language model within the n8n node structure.

How it Works

This comprehensive n8n workflow executes in six main stages:


  1. File Upload Trigger: The process begins when the Google Drive n8n trigger detects a new file (image or reel) uploaded to a specific monitoring folder. This forms the starting point of the entire n8n automation.

  2. File Download: The subsequent Google Drive n8n node downloads the actual file content from Drive into the n8n workflow's temporary memory.

  3. AI Caption Generation: The file's name and context are passed to the OpenAI n8n node (configured with a model like GPT-4o-mini). A highly tailored and engaging Instagram caption, complete with hashtags and a call-to-action, is generated.

  4. Data Logging: The file metadata (name, web view link, thumbnail link) along with the newly generated AI caption are appended to a specified Google Sheet, providing a complete log of all scheduled content.

  5. Media Container Creation: The n8n workflow uses the first Facebook Graph API n8n node to interact with Instagram's API. It takes the file's URL and the generated caption from the Google Sheets step and instructs the API to create a media container (a pending post entry).

  6. Final Publication: The final Facebook Graph API n8n node receives the ID of the newly created media container and executes the media_publish edge, immediately posting the content live to the configured Instagram business account. This completes the fully automated n8n workflow.

Installation Guide

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


  1. Import: Copy the provided n8n workflow JSON and paste it into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. Google Drive Setup: Configure credentials for the 'Post File Upload in Google Drive Folder Trigger' and 'Post File Download in N8N (Google Drive Node)'. Ensure the trigger is set to watch the correct Google Drive folder where your content will be uploaded.

  3. OpenAI Credentials: Set up your API Key credentials for the 'AI Caption generated by OpenAI' n8n node. No further configuration should be needed if you use the existing prompt.

  4. Google Sheets Configuration: Connect the 'Post File Save in Google Sheets' n8n node using your Google Sheets credentials. Specify the Document ID and the Sheet Name where the post details should be logged. The sheet must have columns named 'Name', 'Captions', 'Reel Urls ', and 'Reel Thumbnail'.

  5. Facebook Graph API Setup: This is the most complex step. You must configure Facebook Graph API credentials for both publishing nodes. You need a Facebook Developer account, a registered app, and a token with appropriate permissions (e.g., instagramcontentpublish, pagesshowlist). Crucially, update the Node ID in both Facebook Graph API n8n nodes (17841465053058137) to match your specific Instagram Business Account ID.

  6. Activate: Save and activate the n8n workflow to enable the Google Drive n8n trigger.

Node Details

Post File Upload in Google Drive Folder Trigger (Google Drive Trigger): This n8n trigger is the starting mechanism. It constantly polls a specific Google Drive folder, activating the n8n workflow whenever a new file is detected.
Post File Download in N8N (Google Drive Node): Uses the file ID output by the n8n trigger to download the physical file. This node prepares the file for later steps and extracts the webViewLink and name used in subsequent nodes.
AI Caption generated by OpenAI (OpenAI Node): Leverages the gpt-4o-mini model to generate highly context-specific captions based on the file name received from the Google Drive n8n node. The output caption is crucial for the social media post.
Post File Save in Google Sheets (Google Sheets Node): This n8n node ensures data persistence. It utilizes the appendOrUpdate operation to record the file name, the AI-generated caption, and the file URLs into a defined Google Sheet.
Connect Facebook API for Publishing Instagram Post using N8N (Facebook Graph API Node): This essential n8n node initiates the Instagram publishing process. It uses the media edge to create a container, passing the video URL, caption, and media type (REELS or implicit image setting) retrieved dynamically from the previous Google Sheets output.
Finally Post to Instagram (Facebook Graph API Node): The final step in this n8n workflow. It uses the mediapublish edge, referencing the creationid output by the previous n8n node, to complete the automatic publication to Instagram.

Related n8n Workflows

Free

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

AI Automations Expert | Gen AI Filmmaker | AI Product Builder 🔹 Built 25+ AI Automation Systems Designed and deployed AI workflows using OpenAI, Make.com, Zapier, and AdminitM to automate business processes, save time, and boost productivity.

Featured*