π€ Instagram MCP AI agent β read, reply & manage comments with GPT-4o
π€ Instagram AI Agent with MCP Server β Built for Smart Engagement and Automation
Hi! Iβm Amanda π₯°
I build intelligent automations with n8n and Make.
This powerful workflow was designed to help teams automatically handle Instagram interactions with AI. Using Meta Graph API, LangChain, MCP Server, and GPT-4o, it allows your AI agent to search for posts, read captions, fetch comments, and even reply or message followers, all through structured tools.
π§ What the workflow does
- Searches for recent media using Instagram ID and access token
- Reads and extracts captions or media URLs
- Fetches comments and specific replies from each post
- Replies to comments automatically with GPT-generated responses
- Sends direct messages to followers who commented
- Maps user input and session to keep memory context via LangChain
- Communicates via Server-Sent Events (SSE) using your MCP Server URL
π§° Nodes & Tech Used
LangChain Agent+Chat Modelwith GPT-4oMemory Bufferfor session memorytoolHttpRequestto search media, comments, and send repliesMCP TriggerandMCP Tool(custom SSE connection)Setnode for input and variable assignmentWebhookand JSON for Instagram API structure
βοΈ Setup Instructions
- Create your Instagram App in Meta Developer Portal
- Add your Instagram ID and Access Token in the
Setnode - Update the MCP Server Tool URL in the
MCP Instagramnode- Use your n8n server URL (e.g.
https://yourdomain.com/mcp/server/instagram/sse)
- Use your n8n server URL (e.g.
- Trigger the workflow using the included
LangChain Chat Trigger - Interact via text to ask the agent to:
- βGet latest postsβ
- βReply to comment X with this messageβ
- βSend DM to this user about...β
π₯ Who this is for
- Social media teams managing multiple comments
- Brands automating engagement with followers
- Agencies creating smart, autonomous digital assistants
- Developers building conversational Instagram bots
β Requirements
- Meta Graph API access
- Instagram Business account
- n8n instance (Cloud or Self-hosted)
- MCP Server configured (SSE Endpoint enabled)
- OpenAI API Key (for GPT-4o + LangChain)
π Want to use this workflow?
β€οΈ Buy workflows: https://iloveflows.com
βοΈ Try n8n Cloud: https://n8n.partnerlinks.io/amanda
n8n AI Agent for Comment Management with GPT-4o
This n8n workflow leverages the power of AI to intelligently process and manage comments, likely from platforms like Instagram, using a GPT-4o powered agent. It sets up a sophisticated system where an AI agent can read incoming messages, decide on an appropriate action, and potentially interact with external services via HTTP requests or a Model Context Protocol (MCP) client.
What it does
This workflow defines an AI agent that can:
- Receive Chat Messages: It is triggered by incoming chat messages, acting as the entry point for new comments or interactions.
- Process with an AI Agent: An AI Agent node is at the core, designed to interpret the incoming chat messages. This agent is configured with:
- OpenAI Chat Model (GPT-4o): Utilizes a powerful language model to understand context, intent, and generate responses or actions.
- Simple Memory: Maintains a conversational history, allowing the AI to remember previous interactions within a session.
- HTTP Request Tool: Empowers the AI agent to make external HTTP requests, enabling it to fetch data, interact with APIs, or post information to other services.
- MCP Client Tool: Provides a specialized tool for interacting with a Model Context Protocol (MCP) server, suggesting integration with a broader AI ecosystem or specific model services.
- Edit Fields (Set): A "Set" node is included, which can be used to transform, filter, or map data within the workflow, potentially preparing data for the AI agent or processing its output.
- Sticky Note: A sticky note is present, likely for documentation or temporary notes within the workflow design.
- MCP Server Trigger: An additional trigger is defined for an MCP server, indicating that this workflow can also be part of a larger Model Context Protocol setup, potentially receiving instructions or data from another AI model or service.
Prerequisites/Requirements
To run this workflow, you will need:
- n8n Instance: A running instance of n8n.
- OpenAI API Key: For the "OpenAI Chat Model" node to access GPT-4o. This credential needs to be configured in n8n.
- LangChain Nodes: Ensure the
@n8n/n8n-nodes-langchainpackage is installed in your n8n instance, as many nodes in this workflow belong to it. - HTTP Request Tool Configuration: If the AI agent is intended to make HTTP requests, you will need to configure the necessary URLs, headers, and authentication for the "HTTP Request Tool".
- MCP Client/Server Configuration: If leveraging the Model Context Protocol, you will need to configure the "MCP Client Tool" and potentially the "MCP Server Trigger" with the appropriate endpoints and authentication for your MCP setup.
Setup/Usage
- Import the Workflow: Download the provided JSON and import it into your n8n instance.
- Configure Credentials:
- Locate the "OpenAI Chat Model" node and configure your OpenAI API Key credential.
- If using the HTTP Request Tool, ensure any necessary HTTP credentials are set up in n8n and linked to the tool.
- If using the MCP Client Tool, configure the relevant MCP credentials.
- Activate Triggers:
- Enable the "When chat message received" trigger to start listening for incoming chat messages.
- If you intend for this workflow to be triggered by an MCP server, ensure the "MCP Server Trigger" is also active and correctly configured to listen for incoming MCP requests.
- Customize AI Agent:
- Review the "AI Agent" node's configuration. You might want to adjust the prompt, temperature, or other parameters of the OpenAI Chat Model for optimal performance with your specific use case.
- Examine the "HTTP Request Tool" and "MCP Client Tool" within the AI Agent to ensure they are configured to interact with your desired external services.
- Test the Workflow: Run the workflow manually or send a test chat message to the configured trigger to observe its behavior and ensure it's functioning as expected.
Related Templates
Newsletter signup flow with Email Verification API, Gmail & Google Sheets tracking
Newsletter Sign-up with Email Verification & Welcome Email Automation π Description A complete, production-ready newsletter automation workflow that validates email addresses, sends personalized welcome emails, and maintains comprehensive logs in Google Sheets. Perfect for marketing teams, content creators, and businesses looking to build high-quality email lists with minimal manual effort. β¨ Key Features Email Verification Real-time validation using Verifi Email API Checks email format (RFC compliance) Verifies domain existence and MX records Detects disposable/temporary email addresses Identifies potential spoofed emails Automated Welcome Emails Personalized HTML emails with subscriber's first name Beautiful, mobile-responsive design with gradient headers Branded confirmation and unsubscribe links Sent via Gmail (or SMTP) automatically to valid subscribers Smart Data Handling Comprehensive logging to Google Sheets with three separate tabs Handles incomplete submissions gracefully Preserves original user data throughout verification process Tracks source attribution for multi-channel campaigns Error Management Automatic retry logic on API failures Separate logging for different error types Detailed technical reasons for invalid emails No data loss with direct webhook referencing π― Use Cases Newsletter sign-ups on websites and landing pages Lead generation forms with quality control Marketing campaigns requiring verified email lists Community building with automated onboarding SaaS product launches with email collection Content creator audience building E-commerce customer list management π What Gets Logged Master Log (All Subscribers) Timestamp, name, email, verification result Verification score and email sent status Source tracking, disposable status, domain info Invalid Emails Log Detailed rejection reasons Technical diagnostic information MX record status, RFC compliance Provider information for troubleshooting Invalid Submissions Log Incomplete form data Missing required fields Timestamp for follow-up π§ Technical Stack Trigger: Webhook (POST endpoint) Email Verification: Verifi Email API Email Sending: Gmail OAuth2 (or SMTP) Data Storage: Google Sheets (3 tabs) Processing: JavaScript code nodes for data formatting π Setup Requirements Google Account - For Sheets and Gmail integration Verifi Email API Key - (https://verifi.email) Google Sheets - Pre-configured with 3 tabs (template provided) 5-10 minutes - Quick setup with step-by-step instructions included π Benefits β Improve Email Deliverability - Remove invalid emails before sending campaigns β Reduce Bounce Rates - Only send to verified, active email addresses β Save Money - Don't waste email credits on invalid addresses β Better Analytics - Track conversion rates by source β Professional Onboarding - Personalized welcome experience β Scalable Solution - Handles high-volume sign-ups automatically β Data Quality - Build a clean, high-quality subscriber list π¨ Customization Options Email Template - Fully customizable HTML design Verification Threshold - Adjust score requirements Brand Colors - Match your company branding Confirmation Flow - Add double opt-in if desired Multiple Sources - Track different signup forms Language - Easily translate email content π¦ What's Included β Complete n8n workflow JSON (ready to import) β Google Sheets template structure β Responsive HTML email template β Setup documentation with screenshots β Troubleshooting guide β Customization examples π Privacy & Compliance GDPR-compliant with unsubscribe links Secure data handling via OAuth2 No data shared with third parties Audit trail in Google Sheets Easy data deletion/export π‘ Quick Stats 12 Nodes - Fully automated workflow 3 Data Paths - Valid, invalid, and incomplete submissions 100% Uptime - When properly configured Instant Processing - Real-time email verification Unlimited Scale - Based on your API limits π Perfect For Marketing Agencies SaaS Companies Content Creators E-commerce Stores Community Platforms Educational Institutions Membership Sites Newsletter Publishers π Why Use This Workflow? Instead of manually verifying emails or dealing with bounce complaints, this workflow automates the entire process from sign-up to welcome email. Save hours of manual work, improve your email deliverability, and create a professional first impression with every new subscriber. Start building a high-quality email list today! ---
Add Project Tasks to Google Sheets with GPT-4.1-mini Chat Assistant
Let your team create, track, and manage project tasks through natural conversation. This workflow uses an AI Project Manager Agent that chats with users, gathers the task details it needs, and automatically adds them to a Google Sheet. --- β What this template does Lets you chat naturally with an AI to add new project tasks Automatically detects if the user wants to create or update an item (updates coming soon) Collects Task, Description, and Status fields β allows βdonβt knowβ responses Appends new entries directly into your connected Google Sheets Provides real-time confirmation when the task is added > Trigger: n8n Chat Trigger > Integrations: OpenAI GPT-4.1-mini + Google Sheets (OAuth2) --- π§ How it works The Chat Trigger starts a chat with the user. The AI Project Manager Agent asks guiding questions to gather the task name, description, and status. When all fields are complete (all Info = Yes), the data is passed to the Google Sheets node. The task is automatically added to your project tracker sheet. The AI confirms completion in chat. --- βοΈ Setup instructions Connect OpenAI Go to OpenAI Platform β copy your API key. In n8n, create New Credentials β OpenAI API and paste your key. Ensure your account has active billing under OpenAI Billing. Connect Google Sheets (OAuth2) In n8n β Credentials β New β Google Sheets (OAuth2) Sign in with your Google account and grant access. Select your spreadsheet and tab (e.g., βTasksβ) when prompted. Example sheet: https://docs.google.com/spreadsheets/d/1pbK-B-Q9p8fVjxJIsjEVrAfRgqEPCeYw8rZojZPAb84/edit Test your chat Click Execute Workflow, then start chatting: > βAdd a task for reviewing the project report tomorrow.β The agent will ask questions if needed, then add the record to your sheet. --- π§© Customization ideas Add a Date Added or Assigned To column to the Google Sheet Integrate with Slack or Outlook to message assigned users Extend the agent to support task updates and deletes Replace Google Sheets with Airtable or Notion if preferred --- πͺ Requirements n8n version β₯ 1.100 OpenAI API key Google Sheets account --- π¬ Contact Need help customizing this (e.g., adding deadlines, linking to Notion, or Slack notifications)? π§ robert@ynteractive.com π Robert Breen π ynteractive.com
Multi-channel event countdown manager with Telegram, Slack and Email
This n8n workflow automates the creation and countdown notifications for events like product launches or birthdays via a Telegram bot, ensuring timely group alerts through multi-channel routing (e.g., Slack or email). It processes incoming event data from webhooks, stores it persistently, and triggers scheduled reminders to keep teams or groups informed. Key Features Handles event creation or updates via webhook from Telegram chats or external sources. Fetches and processes upcoming events on a customizable schedule for countdown notifications. Routes alerts dynamically to channels like Slack or email based on event settings. Validates incoming data, formats messages for optimal delivery, and confirms responses to initiators. Workflow Process The Webhook Trigger node starts the workflow when an external system (e.g., Telegram bot) sends a POST request with event details like date, description, and notification preferences. The Process Webhook Event node parses and validates incoming webhook data, ensuring required fields (e.g., event date, channel) are present before proceeding. The Events Database node fetches upcoming events (e.g., launches or birthdays) from a data source, either triggered by the webhook for updates or scheduled for notifications. The Webhook Response node sends a confirmation or status response back to the webhook sender (e.g., Telegram bot) in JSON format. The Schedule Trigger node runs the workflow automatically on a defined schedule (e.g., daily at 9AM) to check for countdown-eligible events. The Is Slack? node checks if the event's notification channel is set to Slack; if true, it routes to Slack-specific formatting. The Format Slack Message node formats the event countdown message in a Slack-friendly layout (e.g., with mentions or embeds). The Send to Slack node sends the formatted message to the target Slack channel for group notifications. The Is Email? node checks if the event's notification channel is set to email (fallback from Slack check); if true, it routes to email-specific formatting. The Format Email node formats the event countdown message in an email-friendly detail (e.g., with HTML for readability). The Send Email node sends the formatted email to the recipient list (e.g., group organizers or participants). Setup Instructions Import the workflow into n8n and configure the Webhook Trigger with your Telegram bot's webhook URL for event creation requests. Set up database credentials in the Events Database node (e.g., connect to PostgreSQL or Airtable for event storage). Configure channel integrations: Slack app token for Send to Slack, SMTP credentials for Send Email, and ensure Schedule Trigger aligns with your countdown frequency (e.g., hourly for real-time alerts). Test by sending a sample POST request to the webhook with event data and manually triggering the schedule to verify notifications. Monitor executions in the n8n dashboard and refine validation logic in Process Webhook Event for custom event fields. Prerequisites Telegram bot with webhook setup for incoming event creation messages. Database service (e.g., PostgreSQL or Google Sheets) for storing and querying events. Slack workspace and email provider (e.g., Gmail SMTP) for notifications. n8n instance with webhook and cron scheduling enabled. Basic API setup for Telegram bot token and channel routing. Modification Options Add a Telegram-specific check node (e.g., "Is Telegram?") branching from Events Database to integrate direct bot messaging. Customize the Schedule Trigger for dynamic timing, like event-specific intervals for countdowns (e.g., daily leading up to the date). Extend Format Slack Message or Format Email with dynamic templates, such as embedding countdown timers or images. Integrate additional channels (e.g., Discord) by duplicating the Is Slack? / Is Email? logic. Enhance Process Webhook Event to support recurring events or auto-populate recipient lists from Telegram group data. Explore More AI Workflows: Get in touch with us for custom n8n automation!