Automated Instagram Comment Reply and CRM Logging - n8n Workflow

Use this powerful n8n workflow to instantly automate Instagram comment responses. It uses Google Sheets for keyword lookup and sends personalized DMs, providing a robust n8n template for social CRM.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Social Media Managers seeking to handle high volumes of engagement efficiently.
E-commerce businesses needing fast, automated customer service responses.
Developers implementing advanced social media integration using the n8n node structure.
Users looking for ready-made n8n templates for Instagram Graph API automation.

Overview

Managing high engagement volumes on social media requires rapid response times, which traditional manual methods cannot sustain. This innovative n8n workflow solves this by creating an instant, intelligent response loop. It leverages an n8n trigger connected to the Instagram Graph API to listen for new comments. When a comment arrives, the system instantly cross-references the initial keyword against a Google Sheet database, providing a highly scalable and easily editable source for automated replies. The subsequent action sends a direct message via the Instagram API and crucially, logs the entire interaction—including user details and timestamps—into a separate Google Sheet CRM log. This ensures that every interaction is tracked, audited, and ready for follow-up, transforming your social media engagement into a fully integrated part of your customer relationship management strategy. This is a crucial n8n workflow for any modern marketing stack.

How it Works

This n8n workflow operates in two main phases: verification and automation.

Phase 1: Webhook Verification


  1. Verification n8n trigger: The Get Verification n8n node receives a GET request from Meta upon webhook subscription.

  2. Response: The Respond to Verification Message n8n node extracts the hub.challenge query parameter and immediately sends it back, completing the verification handshake required by Meta.

Phase 2: Comment Automation


  1. Operational n8n trigger: The Insta Update n8n node receives a POST payload whenever a change occurs on the linked Instagram account.

  2. Comment Check: The Check if update is of comment? n8n node uses a Switch operation to verify if the incoming event payload corresponds specifically to a comments field update.

  3. User Filtering: The Comment if of other user If n8n node ensures that the comment is not made by the connected account itself, preventing unintended reply loops.

  4. Keyword Lookup: The Comment List Google Sheets n8n node performs a lookup. It extracts the first word of the incoming comment, converts it to lowercase, and searches for a match in the designated 'Comment Responses' Google Sheet. If a match is found, it retrieves the corresponding automated Message.

  5. Send Automated DM: The Send Message for Comment HTTP Request n8n node utilizes the retrieved response message and the user's ID to construct a Graph API request. This sends a Direct Message (DM) to the user who left the comment.

  6. CRM Logging: Finally, the Add Interation in Sheet (CRM) Google Sheets n8n node appends the interaction details (Timestamp, User ID, Username, and any potential error notes from the DM attempt) to the 'Interation List' CRM sheet, completing the tracking cycle of this n8n template.

Installation Guide

To deploy this comprehensive n8n workflow, follow these steps:


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

  2. Set up Meta Developer App: Follow the prerequisites detailed in the sticky notes within the workflow, ensuring you have the necessary instagrambasic, instagrammanagecomments, and instagrammanagemessages permissions enabled.

  3. Configure Webhooks: Set your Meta App webhook URL to YOURN8N_DOMAIN/webhook/instagram and select the comments field subscription.

  4. Update Credentials:

Google Sheets: Provide credentials for the Akash Google Sheet Account. Ensure the sheet ID and specific sheet names (gid=0 for responses, gid=76673878 for interaction log) are updated if you are using a new document.
Instagram Access Token: Update the IG Access Token credential used in the Send Message for Comment n8n node. This needs a long-lived User Access Token with the required permissions.

  1. Activate the n8n trigger: Save and activate the n8n workflow to enable real-time comment monitoring.

Node Details

This n8n template relies on several crucial n8n node types for its functionality:

Insta Update & Get Verification (Webhook n8n trigger nodes):
Function: Act as the entry points for external Meta/Instagram notifications. Insta Update receives comment data, while Get Verification handles the initial subscription handshake.
Key Configuration: Both use the same path /instagram.

Check if update is of comment? (Switch n8n node):
Function: Ensures processing only continues if the incoming payload confirms a new comment was made (field equals comments).

Comment if of other user (If n8n node):
Function: Implements a critical piece of flow control by checking if the comment author ID is different from the account ID. If the IDs are equal, the workflow stops, preventing self-replies.

Comment List (Google Sheets n8n node):
Function: Performs the dynamic keyword lookup. It searches the designated sheet by matching the first word of the comment against the Comment column.
Key Configuration: Uses an expression ={{ $json.body.entry[0].changes[0].value.text.split()[0].toLowerCase() }} for the lookup value.

Send Message for Comment (HTTP Request n8n node):
Function: Executes the core action: sending a Direct Message response via the Instagram Graph API (v23.0).
Key Configuration: Uses JSON body expressions to dynamically insert the recipient ID and the message text retrieved from the Google Sheets n8n node.

Add Interation in Sheet (CRM) (Google Sheets n8n node):
* Function: Appends new row data (Time, User Id, Username, Note) to the CRM log sheet, providing persistent tracking of every automated interaction. It uses the append operation.

Related n8n Workflows

Free

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

I'm a developer with 5 years of experience in Python and Node.js. Over the past year, I've been building workflows to streamline operations for my team. I have also developed RAG chatbots, AI agents, and WhatsApp automation. If you need any help with N8N workflows, let's connect over a call and solve it together!

Featured*