Overview
This node acts as a trigger for incoming Facebook Messenger events. It listens to various types of messaging events sent by Facebook pages, such as messages from users, delivery confirmations, read receipts, postbacks, opt-ins, and message echoes. When one of the selected event types occurs, the node captures the event data and outputs it for further processing in an n8n workflow.
Common scenarios where this node is beneficial include:
- Automating responses or workflows based on user messages received via Facebook Messenger.
- Tracking message delivery and read statuses to update CRM or analytics systems.
- Handling postback buttons clicked by users in Messenger bots.
- Processing opt-in events for subscription or consent management.
- Debugging or logging raw webhook data from Facebook Messenger.
Practical example: A business could use this node to trigger a workflow that sends a welcome message when a user first messages their Facebook page, or to log all message reads and deliveries for customer support follow-up.
Properties
| Name | Meaning |
|---|---|
| Verify Token | The secret token used to verify the webhook with Facebook during setup. |
| Event Types | The specific Facebook Messenger event types to listen for. Options include: |
| - Message Deliveries (delivery confirmations) | |
| - Message Echoes (echo messages sent by your page) | |
| - Message Reads (read receipts) | |
| - Messages (messages sent by users) | |
| - Messaging Optins (opt-in events) | |
| - Messaging Postbacks (postback events) | |
| Include Raw Data | Whether to include the full raw webhook data in the output JSON for debugging or extended processing. |
Output
The node outputs an array of JSON objects, each representing a single Facebook Messenger event matching the selected event types. Each event object contains:
eventType: The type of event (e.g., "messages", "message_deliveries").senderId: The Facebook ID of the sender.recipientId: The Facebook ID of the recipient (usually the page).timestamp: The event timestamp.- Additional fields depending on the event type, for example:
- For messages:
messageId,text,attachments(with type and URL or payload), and optionallyquickReply. - For deliveries:
mids(message IDs delivered),watermark. - For reads:
watermark. - For postbacks:
payload,title, and optionalreferral. - For opt-ins:
ref,userRef. - For message echoes:
messageId,appId,metadata, and attachments.
- For messages:
If the "Include Raw Data" option is enabled, the original raw webhook event data is included under the rawData property.
No binary data is output by this node.
Dependencies
- Requires a valid Facebook Messenger API authentication credential configured in n8n.
- The node must be set up with a publicly accessible webhook URL registered in the Facebook Developer Console.
- The "Verify Token" property must match the token configured in the Facebook webhook settings for verification.
Troubleshooting
- Verification failed: If the webhook verification fails during setup, ensure the "Verify Token" matches exactly between Facebook and the node configuration.
- Invalid request / No entries found: These errors indicate malformed or unexpected webhook payloads. Confirm that Facebook is sending valid page events and that the webhook URL is correctly configured.
- No events triggered: Check that the desired event types are selected in the node properties and that Facebook is actually sending those event types.
- Error processing message: This generic error may occur if the webhook payload structure changes or contains unexpected data. Enabling "Include Raw Data" can help debug the issue.
- Ensure the node has the required API credentials and permissions to receive Messenger events.