πŸ’¬ Auto-reply to Instagram DMs with an AI chatbot and Google Gemini history

⚑ 2,995 views Β· πŸ’¬ Support Chatbots

πŸ’‘ Pro Tip β€” Heads up β€” if this workflow’s Instagram scraping breaks (it happens whenever Meta updates their frontend), ScraperNode is a community node that handles profiles, posts, reels, and comments without any HTML parsing.

View All Scrapers

Description

Auto-reply Instagram DM with AI Chatbot, Conversation History using Google Gemini and n8n Data Table

This workflow turns your Instagram Business or Creator account into an AI-powered customer support chatbot using Google Gemini and n8n Data Table for persistent conversation history. Every incoming Direct Message is automatically received, processed, and replied to β€” with long AI responses intelligently split and delivered in sequence.

If you need to automate Instagram DM responses without managing complex infrastructure, this workflow is the right starting point.

How it works

How to use

  1. Create a Meta App and add the Instagram product.
  2. Go to Instagram > API Setup with credentials β†’ log in to your IG Business/Creator account β†’ copy the long-lived Access Token β†’ paste it into the Set Context node (ig_access_token field).
  3. Activate the workflow in production mode first, then go to Meta App > Instagram > Webhooks: paste the n8n production webhook URL + a Verify Token β†’ click Verify.
  4. Connect Google Gemini (googlePalmApi) credential in the AI Agent and LLM nodes.
  5. Create the n8n Data Table
  6. Edit the system prompt inside Process Merged Message to set your AI persona, brand tone, and knowledge base.
  7. Activate and start receiving automated replies on Instagram DM.

Requirements

Customizing this workflow


About the Author

Created by: Nguyα»…n Thiệu ToΓ n (Jay Nguyen) Email: me@nguyenthieutoan.com Website: nguyenthieutoan.com Company: GenStaff (genstaff.net) Socials (Facebook / X / LinkedIn): @nguyenthieutoan More templates: n8n.io/creators/nguyenthieutoan

πŸ”— Nodes Used

HTTP Request, Webhook, AI Agent, Google Gemini Chat Model, Data table

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup