πŸ“± Automate Instagram comment responses with Google Sheets & CRM tracking

⚑ 1,565 views Β· πŸ“± Social Media & Email Marketing

Description

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

🎯 Overview

This n8n workflow template automates the process of monitoring Instagram comments and sending predefined responses based on specific comment keywords. It integrates Instagram’s Graph API with Google Sheets to manage comment responses and maintains an interaction log for customer relationship management (CRM) purposes.

πŸ”§ Workflow Components

The workflow consists of 9 main nodes organized into two primary sections:

πŸ“‘ Section 1: Webhook Verification

πŸ€– Section 2: Auto Comment Response

πŸ› οΈ Prerequisites and Setup Requirements

1. πŸ”΅ Meta/Facebook Developer Setup

πŸ“± Create Facebook App

> πŸ“‹ Action Items: > - [ ] Navigate to Facebook Developers > - [ ] Click β€œCreate App” and select β€œBusiness” type > - [ ] Configure the following products: > - βœ… Instagram Graph API > - βœ… Facebook Login for Business
> - βœ… Webhooks

πŸ” Required Permissions

Configure the following permissions in your Meta app: | instagram_basic | πŸ“– Read Instagram account profile info and media | instagram_manage_comments | πŸ’¬ Create, delete, and manage comments | instagram_manage_messages | πŸ“€ Send and receive Instagram messages | pages_show_list | πŸ“„ Access connected Facebook pages

🎫 Access Token Generation

> ⚠️ Important Setup:+ > - [ ] Use Facebook’s Graph API Explorer > - [ ] Generate a User Access Token with required permissions > - [ ] ⚑ Important: Tokens expire periodically and need refreshing

2. 🌐 Webhook Configuration

πŸ”— Setup Webhook URL

> πŸ“Œ Configuration Checklist: > - [ ] In Meta App Dashboard, navigate to Products β†’ Webhooks > - [ ] Subscribe to Instagram object > - [ ] Configure webhook URL: your-n8n-domain/webhook/instagram > - [ ] Set verification token (use β€œtest” or create secure token) > - [ ] Select webhook fields: > - βœ… comments - For comment notifications > - βœ… messages - For DM notifications (if needed)

βœ… Webhook Verification Process

The workflow handles Meta’s webhook verification automatically:

3. πŸ“Š Google Sheets Setup

Example - https://docs.google.com/spreadsheets/d/1ONPKJZOpQTSxbasVcCB7oBjbZcCyAm9gZ-UNPoXM21A/edit?usp=sharing

πŸ“‹ Create Response Management Sheet

Set up a Google Sheets document with the following structure:

πŸ“ Sheet 1 - Comment Responses:

ColumnDescriptionExample
πŸ’¬ CommentTrigger keywords"auto", "info", "help"
πŸ“ MessageCorresponding response message"Thanks for your comment! We'll get back to you soon."

πŸ“ˆ Sheet 2 - Interaction Log:

ColumnDescriptionPurpose
⏰ TimeTimestamp of interactionTrack when interactions occur
πŸ†” User IdInstagram user IDIdentify unique users
πŸ‘€ UsernameInstagram usernameHuman-readable identification
πŸ“ NoteAdditional notes or error messagesDebugging and analytics

πŸ”§ Built By - akash@codescale.tech

πŸ”— Nodes Used

Google Sheets, HTTP Request, Webhook

πŸ“₯ Import

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

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