Overview
This node allows sending various types of messages and actions through Facebook Messenger. It supports sending text, media (images, audio, video, files), template messages (generic, button, media templates), marking a message as seen, and sending typing indicators. This node is useful for automating customer interactions on Facebook Messenger, such as sending notifications, customer support replies, or interactive message templates.
Practical examples:
- Sending a welcome text message to a user who just started a conversation.
- Sending an image or video file to showcase a product.
- Sending a generic template with multiple elements and buttons for product catalogs.
- Marking a message as seen after processing it.
- Showing the typing indicator while preparing a response.
Properties
| Name | Meaning |
|---|---|
| Recipient ID | The Page-Scoped ID (PSID) or thread ID of the recipient to whom the message or action applies. |
| Operation | The action to perform: Send Message, Send Template, Mark Seen, or Send Typing Indicator. |
For Send Message operation:
| Name | Meaning |
|---|---|
| Message Type | Type of message to send: Audio, File, Image, Text, Video |
| Message Text | Text content of the message (required if Message Type is Text) |
| Media URL | URL of the media file to send (required if Message Type is Audio, File, Image, or Video) |
| Add Quick Replies | Whether to add quick reply buttons to the message |
| Quick Replies | List of quick replies with content type (Text, Phone Number, Email), title, payload, and optional image URL |
For Send Template operation:
| Name | Meaning |
|---|---|
| Template Type | Type of template: Generic, Button, or Media |
If Template Type is Generic:
| Name | Meaning |
|---|---|
| Elements | List of elements each with title, subtitle, image URL, default action URL, and optional buttons |
If Template Type is Button:
| Name | Meaning |
|---|---|
| Text | Text content of the button template (required) |
| Buttons | List of buttons with type (Web URL or Postback), title, URL or payload |
If Template Type is Media:
| Name | Meaning |
|---|---|
| Media Type | Type of media: Image or Video |
| Media URL | URL of the media (required) |
| Add Buttons | Whether to add buttons to the media template |
| Buttons | List of buttons similar to Button template |
For Mark Seen operation:
- No additional properties besides Recipient ID.
For Send Typing Indicator operation:
| Name | Meaning |
|---|---|
| Typing Indicator | Typing indicator state: Typing On or Typing Off |
Output
The node outputs JSON data representing the response from the Facebook Graph API for each input item processed. The output includes details about the success or failure of the request.
json: Contains the full API response object.pairedItem.item: Index of the input item this output corresponds to.
No binary data is output by this node.
Dependencies
- Requires a valid Facebook Messenger API access token credential configured in n8n.
- Uses Facebook Graph API v17.0 endpoint
https://graph.facebook.com/v17.0/me/messages. - Internet connectivity to reach Facebook's API.
Troubleshooting
- Invalid or expired access token: The node will fail if the provided API token is invalid or expired. Refresh or reconfigure the API credentials.
- Recipient ID errors: Ensure the recipient ID is correct and corresponds to a valid PSID or thread ID.
- Missing required parameters: For example, sending a text message without providing message text will cause an error.
- API rate limits: Facebook may throttle requests if too many are sent in a short time.
- Malformed template or button data: Incorrectly structured template elements or buttons can cause API errors.
- To resolve errors, check the error message returned in the node output and verify all required fields and formats.