n8n

How to Automate Instagram Posts from Google Sheets?

Keep your Instagram active without daily effort. The workflow takes the next idea from a planning sheet, turns it into a finished image and caption, and posts it for you. It is ideal for marketers and creators who plan topics ahead but want hands off publishing.

A scheduled check looks for the next row in Google Sheets with Status set to 0. Google Gemini writes one content concept, expands it into two detailed image prompts, and then creates a short caption with hashtags. The first prompt is sent to Replicate to generate a square image. The flow formats the image URL and caption, creates an Instagram media container, waits for processing, publishes the post, and marks the sheet row as Status 1 so it will not repeat.

Setup needs a business or creator Instagram connected to a Facebook Page, Meta access for the Instagram Graph API, a Replicate API key, and Google access for Sheets and Gemini. Runs take minutes and cut manual work from hours to a few minutes. Great for agencies, social teams, and solo brands that want steady visuals and consistent copy aligned to their plan.

What are the key features?

  • Scheduled start checks Google Sheets for the next idea with Status 0
  • Google Sheets node returns the first matching row to avoid overposting
  • Input mapping sets Topic, Audience, Voice, and Platform for content control
  • Gemini creates one content concept and outputs clean JSON
  • Gemini expands the concept into two detailed image prompt options
  • Replicate Flux generates a square image from the first prompt
  • Gemini writes a short caption with relevant hashtags
  • Instagram Graph API creates a media container, waits, and publishes
  • Google Sheets updates the Status column to prevent duplicates

What are the benefits?

  • Reduce manual work from 2 hours to 5 minutes per post
  • Automate 90% of repetitive posting tasks
  • Improve content consistency with scheduled runs
  • Handle 5 times more posts per week without extra staff
  • Connect planning, creation, and publishing in one flow
  • Lower copy paste errors by using structured steps

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Google Sheets, Google Gemini, Replicate and Instagram Graph API. See the Tools Required section above for links to create accounts with these services.
  3. In n8n, open the Credentials menu and create a Google Sheets OAuth2 credential. Use the Google account that owns the planning sheet.
  4. Open the Get Next Post Idea from Sheet node. Select your Google Sheets credential, choose the Document ID and Sheet. Confirm the filter is Status equals 0 and that Return first match is enabled.
  5. Open the Set node for input variables and confirm fields map to your sheet columns for Topic, TargetAudience, BrandVoice, and Platform.
  6. Create a Google Gemini credential in n8n. Choose the Google PaLM or Gemini credential type, click Create new credential, and paste the API key from your Google AI Studio account.
  7. Create a Replicate API key in your Replicate account. In n8n, add an HTTP Header Auth credential. Set the Authorization header to Token followed by your key, and select it in the HTTP Request node.
  8. Prepare Instagram access. Your Instagram must be a Business or Creator account linked to a Facebook Page. In n8n, create a Facebook Graph API credential and connect the Facebook account that manages the target Instagram account.
  9. Open the Create Instagram Media Container and Publish Post nodes. Choose the Facebook Graph API credential and select the correct Instagram account or Page as prompted.
  10. Check the Replicate node parameters. Confirm the model path matches Flux 1.1 Pro Ultra and aspect ratio is 1:1. Adjust guidance settings only if needed.
  11. Run a test with a sample row in your sheet. Confirm Gemini returns JSON in the parser nodes, Replicate returns an image URL, and Instagram shows a new post.
  12. If publishing fails, increase the Wait node time to allow more processing. If Instagram errors mention permissions, verify the account type and that the token has the instagram_basic and pages manage permissions.
  13. After tests pass, enable the workflow and set the schedule. Keep the Status column accurate so each idea posts once.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Google Gemini

Sign up

Free tier: $0 via Gemini API; e.g., Gemini 2.5 Flash-Lite free limits 1,000 requests/day (15 RPM, 250k TPM). Paid from $0.10/1M input tokens and $0.40/1M output tokens.

Google Sheets

Sign up

Free: $0 (Google Sheets API usage has no additional cost; quota limits apply)

Instagram Graph API

Sign up

Process manually

Replicate

Sign up

Pay-as-you-go: $0 / mo; usage-based. Hardware from $0.000025/sec (CPU Small) and $0.000225/sec (Nvidia T4 GPU).

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.