instagram-dm

Package Information

Released: 6/4/2025
Downloads: 0 weekly / 0 monthly
Latest Version: 0.1.0-beta.1
Author: uppfy

Documentation

Banner image

n8n-nodes-instagram-dm

This is an n8n community node that provides Instagram Direct Messaging functionality via the Meta Graph API.

Features

  • Send Direct Messages: Send text messages to Instagram users
  • List Conversations: Retrieve list of conversations for your Instagram Business Account
  • Get Conversation Details: Fetch details and messages from specific conversations
  • Secure Authentication: Built-in credential management with encrypted storage
  • Error Handling: Comprehensive error handling and logging

Prerequisites

Before using this node, you need:

  1. Instagram Business Account: A verified Instagram Business Account
  2. Facebook App: A Facebook App with Instagram permissions
  3. Access Token: A valid Access Token with the following permissions:
    • instagram_basic
    • instagram_manage_messages
    • pages_messaging

Installation

To install this community node in n8n:

Via npm (when published)

npm install n8n-nodes-instagram-dm

Via n8n Community Nodes (when published)

  1. Go to Settings → Community Nodes
  2. Click "Install a community node"
  3. Enter: n8n-nodes-instagram-dm

For Development

  1. Clone this repository
  2. Run npm install
  3. Run npm run build
  4. Link to your n8n installation

Setup

1. Create Instagram DM API Credentials

  1. In n8n, go to CredentialsNew Credential
  2. Search for "Instagram DM API"
  3. Fill in:
    • Access Token: Your Instagram Graph API access token
    • Instagram Business Account ID: Your Instagram Business Account ID

2. Test Your Credentials

The credential includes a built-in test that verifies:

  • Your access token is valid
  • Your Instagram Business Account ID is accessible

Usage

Send Message

Send a direct message to an Instagram user:

Required Parameters:

  • Recipient ID: Instagram User ID of the message recipient
  • Message Text: The text content of your message

Optional Parameters:

  • Messaging Product: Set to "instagram" (default)

List Conversations

Retrieve conversations for your Instagram account:

Optional Parameters:

  • Limit: Number of conversations to return (default: 25, max: 50)
  • Fields: Comma-separated list of fields to include (default: "id,participants,updated_time")

Get Conversation

Get details of a specific conversation:

Required Parameters:

  • Conversation ID: ID of the conversation to retrieve

Optional Parameters:

  • Fields: Comma-separated list of fields to include (default: "id,participants,messages,updated_time")

Example Workflows

Basic Message Sending

Trigger → Instagram DM (Send Message)

Customer Service Bot

Webhook → Code Node (Process) → Instagram DM (Send Message)

Conversation Monitor

Schedule → Instagram DM (List Conversations) → Filter → Instagram DM (Get Conversation)

API Reference

This node uses the Meta Graph API v19.0. For detailed API documentation, visit:

Troubleshooting

Common Issues

  1. "Invalid Access Token"

    • Verify your token hasn't expired
    • Ensure proper permissions are granted
    • Check if your Facebook App is approved for production
  2. "Recipient ID not found"

    • Verify the Instagram User ID is correct
    • Ensure the user has previously interacted with your business account
  3. "Rate limit exceeded"

    • Instagram has rate limits on messaging
    • Implement delays between messages
    • Monitor your API usage

Getting Help

Development

Building the Node

npm run build

Linting

npm run lint
npm run lintfix

Testing

npm test

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Run linting and ensure builds pass
  6. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Support

If you find this node helpful, please consider:

  • ⭐ Starring this repository
  • 📢 Sharing it with others
  • 🐛 Reporting bugs and issues
  • 💡 Suggesting new features

Note: This is a community-maintained node and is not officially supported by n8n or Meta/Facebook. Use at your own discretion and ensure compliance with Instagram's Terms of Service and API policies.

Discussion