Actions2
- Direct Messages Actions
Overview
This node enables sending direct messages via the Instagram Business API. Specifically, for the "Direct Messages" resource and the "Send Message" operation, it allows users to send plain text messages directly to an Instagram user identified by their Instagram User ID (IGID). This is useful for automating customer support replies, sending notifications, or engaging with followers through personalized messages.
Practical examples:
- Automatically reply to a user's inquiry received via Instagram Direct Message.
- Send welcome messages to new followers or customers.
- Notify users about updates, promotions, or events directly on Instagram.
Properties
| Name | Meaning |
|---|---|
| Instagram User ID | The unique Instagram User ID (IGID) of the recipient. Found in webhook data or user profile. Required to specify the message recipient. |
| Message Text | The content of the text message to send to the specified Instagram user. |
Output
The node outputs a JSON object containing details about the sent message:
success: Boolean indicating if the message was sent successfully.operation: The operation performed, here always"sendMessage".userId: The Instagram User ID to whom the message was sent.messageText: The text content that was sent.messageId: The unique identifier of the sent message returned by the Instagram API.sentAt: Timestamp when the message was sent.apiResponse: The full raw response from the Instagram API for further inspection.timestamp: The time when the node executed.nodeVersion: Version of the node implementation.
If an error occurs, the output JSON will contain:
error: Error message describing what went wrong.operationandresource: To identify which action failed.success: Set to false.timestamp: Execution time of the failure.
Dependencies
- Requires an active Instagram Business account connected via the Meta API.
- Needs an API authentication token (access token) with permissions to send Instagram messages.
- The node uses the official Instagram Graph API endpoint (
https://graph.facebook.com/v18.0). - Proper credentials must be configured in n8n to authenticate API requests.
Troubleshooting
Common issues:
- Invalid or expired access token causing authentication failures.
- Incorrect Instagram User ID leading to "recipient not found" errors.
- Insufficient permissions on the access token to send messages.
- Network or API rate limiting errors.
Error messages:
API Error: ... (Code: ...): Indicates an error response from the Instagram API. Check the error message for details such as permission issues or invalid parameters.Request failed: ...: Indicates network or fetch-related problems.
Resolutions:
- Verify and refresh the API authentication token.
- Confirm the Instagram User ID is correct and corresponds to a valid recipient.
- Ensure the connected Instagram Business account has messaging permissions enabled.
- Handle rate limits by adding retries or delays.