Overview
This node integrates with the Facebook Messenger API to send messages to specified recipients. It is useful for automating communication via Facebook Messenger, such as sending notifications, alerts, or customer support messages directly to users on Facebook.
A practical example would be a workflow that sends a confirmation message to a user after they complete a form or make a purchase, using their Facebook Messenger ID as the recipient.
Properties
| Name | Meaning |
|---|---|
| Recipient ID | The Facebook Messenger ID of the recipient to whom the message will be sent. |
| Message | The text content of the message to send. |
Output
The node outputs JSON data representing the response from the Facebook Messenger API after attempting to send the message. This typically includes details about the message delivery status.
Example output structure:
{
"recipient_id": "123456789",
"message_id": "mid.$cAAE2a1b2c3d4e5f6g7h8i9j0"
}
If an error occurs and the node is configured to continue on failure, the output JSON will contain an error field with the error message.
Dependencies
- Requires a valid Facebook Messenger API authentication token (API key credential) configured in n8n.
- The node makes HTTP POST requests to the Facebook Graph API endpoint at
https://graph.facebook.com/v18.0/me/messages.
Troubleshooting
Common issues:
- Invalid or expired API token: Ensure the Facebook Messenger API credentials are correctly set up and have not expired.
- Incorrect recipient ID: Verify that the recipient ID corresponds to a valid Facebook Messenger user who has interacted with your page.
- Message format errors: The message must be a non-empty string; otherwise, the API may reject the request.
Error messages:
- If the API returns an error, it will be included in the node's output under the
errorfield if "Continue On Fail" is enabled. - Common API errors include permission issues, invalid tokens, or malformed requests. Check the Facebook Developer documentation for specific error codes and resolutions.
- If the API returns an error, it will be included in the node's output under the