This workflow contains community nodes that are only compatible with the self-hosted version of n8n.
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.
The workflow consists of 9 main nodes organized into two primary sections:
📋 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
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
⚠️ Important Setup:+
- [ ] Use Facebook's Graph API Explorer
- [ ] Generate a User Access Token with required permissions
- [ ] ⚡ Important: Tokens expire periodically and need refreshing
📌 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)
The workflow handles Meta's webhook verification automatically:
hub.challenge
parameterExample - https://docs.google.com/spreadsheets/d/1ONPKJZOpQTSxbasVcCB7oBjbZcCyAm9gZ-UNPoXM21A/edit?usp=sharing
Set up a Google Sheets document with the following structure:
📝 Sheet 1 - Comment Responses:
Column | Description | Example |
---|---|---|
💬 Comment | Trigger keywords | "auto", "info", "help" |
📝 Message | Corresponding response message | "Thanks for your comment! We'll get back to you soon." |
📈 Sheet 2 - Interaction Log:
Column | Description | Purpose |
---|---|---|
⏰ Time | Timestamp of interaction | Track when interactions occur |
🆔 User Id | Instagram user ID | Identify unique users |
👤 Username | Instagram username | Human-readable identification |
📝 Note | Additional notes or error messages | Debugging and analytics |