Automated Instagram Comment Reply and Tracking System - n8n Workflow

Use this robust scheduled n8n workflow to automatically monitor specific Instagram posts, filter new comments, send standardized replies via DM or comment, and track all contacted users in Google Sheets to prevent duplicates. Leverage powerful n8n node logic for social media scaling.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Social media managers or influencers handling high volumes of comments on viral posts or reels.
Users who need reliable, scheduled automation, utilizing the n8n trigger function.
Developers looking for advanced n8n templates involving API interaction, Google Sheets, and custom deduplication logic.
Businesses aiming to automate lead qualification based on Instagram engagement.

Overview

Managing comments on highly engaging Instagram posts can be time-consuming and risks missing potential leads or frustrating users with duplicate replies. This specialized n8n workflow solves this by providing a hands-off, scheduled monitoring solution. The workflow uses an external API (like upload-post.com) to fetch and send replies, a necessary component for Instagram automation.

The key innovation of this n8n workflow is the use of the Google Sheets n8n node coupled with a custom Code n8n node to maintain a historical database of contacted users. By reading existing comment IDs from the spreadsheet before attempting a reply, the system ensures that only genuinely new commenters receive a message, making this n8n template highly efficient and professional.

How it Works

This comprehensive n8n workflow initiates either manually via the Start Monitoring n8n node or automatically via the Schedule Trigger (set to run every 15 minutes):


  1. Configuration: The Configure Post & Message n8n node defines the target Instagram post URL, the standard reply message, and the profile username.

  2. Historical Check: The Read Contacted Users Google Sheets n8n node pulls all previously recorded comment IDs and usernames from your designated spreadsheet.

  3. Data Fetching: The Get Post Comments HTTP Request n8n node calls the external API to retrieve all current comments for the target post.

  4. Deduplication Logic: The crucial Filter New Comments Code n8n node compares the current comments against the historical list retrieved from Google Sheets. It uses complex JavaScript logic to normalize long comment IDs and outputs only items that have not yet been contacted.

  5. Flow Gate: The Check If Has New Comments If n8n node ensures the workflow proceeds only if new comments are found. Otherwise, the cycle ends with a summary.

  6. Action: The Send Reply to Comment HTTP Request n8n node uses the external platform's API to post the configured reply message to the new comment.

  7. Tracking & Logging: The Check Reply Success n8n node verifies the API result. If successful, the Record Contacted User Google Sheets n8n node appends the new comment details to the tracking sheet. If it fails, the Log Failed Reply Code n8n node captures the error.

  8. Summary: The Generate Summary Code n8n node aggregates the results (total comments found, new comments processed, successful replies) and logs a final status message for the monitoring cycle. This confirms the effective operation of the entire n8n workflow.

Installation Guide

To deploy this n8n template, follow these steps:


  1. Import: Copy the provided JSON and import it into your n8n instance.

  2. Credentials Setup:

Google Sheets: Set up your Google Sheets OAuth2 API credentials. Ensure the account has permission to read from and append data to the target spreadsheet.
External API: Configure an HTTP Header Auth credential named 'upload-post vitor' (or update the credential reference in the HTTP Request nodes) with the necessary API key for the Instagram automation service.

  1. Spreadsheet Preparation: Create a Google Sheet with columns matching the data required for tracking: commentid, username, messagesent, timestamp, and post_url. This sheet is essential for the deduplication logic used by the n8n node.

  2. Initial Configuration: Update the Configure Post & Message n8n node with your specific Instagram post URL, your profile username, and the desired reply message.

  3. Activation: Set the n8n workflow to 'Active' to enable the scheduled n8n trigger.

Node Details

Schedule Trigger & Start Monitoring: The primary n8n trigger mechanism. It ensures the n8n workflow executes every 15 minutes for continuous, real-time comment monitoring.
Configure Post & Message (Set n8n node): Centralized parameters for the post URL and the exact text of the replyMessage. Essential for easy management of this n8n template.
Google Sheets (Read Contacted Users): Reads the historical data sheet. Its alwaysOutputData setting ensures the custom filtering Code n8n node has the necessary input.
HTTP Request (Get Post Comments): Retrieves comments for the specified post using query parameters configured dynamically from the Set n8n node.
Filter New Comments (Code n8n node): Contains critical custom scripting logic to compare two datasets (new comments vs. historical records), filter out already processed comments, and normalize complex Instagram numerical IDs. This sophisticated custom n8n node is the heart of the deduplication process.
HTTP Request (Send Reply to Comment): Executes the main action, sending the automatic reply via the external API, utilizing the comment ID gathered in the previous n8n node steps.


  • Google Sheets (Record Contacted User): An Append operation that logs successful interactions, maintaining the integrity of the tracking system for the next n8n trigger cycle.

Related n8n Workflows

Free

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

Follow me in linkedin: https://www.linkedin.com/in/juan-carlos-cavero-gracia/

Featured*