N8N Tools - Facebook Enhanced icon

N8N Tools - Facebook Enhanced

Comprehensive Facebook Graph API integration for N8N workflows

Messaging → Send Message

AI-generated

Overview

This node integrates with the Facebook Graph API to perform various operations across multiple Facebook resources. Specifically, for the Messaging resource and the Send Message operation, it allows sending a text message from a Facebook Page to a recipient identified by their Page Scoped User ID (PSID). This is useful in scenarios such as automating customer support replies, sending notifications, or engaging users via Messenger directly from an n8n workflow.

Practical examples include:

  • Sending order updates or confirmations to customers.
  • Responding automatically to user inquiries received on a Facebook Page.
  • Broadcasting announcements or alerts to specific users who have interacted with the page.

Properties

Name Meaning
Page ID The unique identifier of the Facebook Page that will send the message.
Recipient ID The PSID (Page Scoped User ID) of the recipient user who will receive the message.
Message The text content of the message to be sent to the recipient.

Output

The node outputs JSON data representing the response from the Facebook API after attempting to send the message. This typically includes details about the message delivery status or any error information if the request failed.

If multiple input items are processed, the output is an array where each element corresponds to the result of sending a message for each input item.

The node does not output binary data for this operation.

Dependencies

  • Requires valid Facebook API credentials with permissions to send messages on behalf of the specified Facebook Page.
  • Requires an API key credential for the external "N8N Tools API" service used for subscription validation.
  • The node uses the Facebook Graph API v23.0 endpoints internally.
  • Proper configuration of OAuth2 or API key credentials within n8n is necessary for authentication.

Troubleshooting

  • Invalid Subscription or API Key: If the node throws an error indicating invalid subscription or API key, verify that the API key credential for the external service is correct and active.
  • Permission Errors: Facebook may reject the message if the Page does not have messaging permissions or if the recipient has not interacted with the Page before. Ensure the Page has proper permissions and the recipient PSID is valid.
  • Rate Limits: Facebook enforces rate limits on messaging. Excessive requests may cause errors; implement delays or retries as needed.
  • Incorrect IDs: Double-check that the Page ID and Recipient ID are accurate and correspond to existing entities.
  • Message Content Issues: Empty or malformed message content can cause failures. Ensure the message string is properly formatted and non-empty.

Links and References

Discussion