Actions32
- Bot Actions
- Callback Actions
- Chat Actions
- File Actions
- Message Actions
- Payment Actions
- Sticker Actions
Overview
The node integrates with the Bale Messenger API to send various types of messages and perform chat-related actions. Specifically, for the Message resource and Send Document operation, it allows sending document files to a specified chat in Bale Messenger.
This is useful when you want to automate sending documents such as PDFs, Word files, or any other file type supported by Bale Messenger directly from your workflows. For example, you could automatically send invoices, reports, or contracts to users or groups after certain triggers or events.
Properties
Name | Meaning |
---|---|
Chat ID | Unique identifier for the target chat where the document will be sent. |
Binary Data | Boolean flag indicating whether the document data should be taken from a binary field in the input data (true) or referenced by an existing file ID on Bale servers (false). |
Binary Property | The name of the binary property that contains the document data to upload when Binary Data is true. |
File ID | Identifier of a file already stored on Bale servers to send instead of uploading new data (used when Binary Data is false). |
Reply Markup | Additional interface options for the message's reply interface. Options include: None, Inline Keyboard, Reply Keyboard, Reply Keyboard Remove. |
Inline Keyboard | Configuration for an inline keyboard attached to the message, consisting of rows and buttons with text, callback data, or URLs. |
Reply Keyboard | Configuration for a custom reply keyboard with rows and buttons containing text options. |
Reply Keyboard Remove | Options to remove a custom keyboard, including whether to remove it and if removal should be selective for specific users. |
Reply To Message ID | If the document message is a reply, this is the ID of the original message being replied to. |
Caption | Optional caption text to accompany the document, up to 1024 characters. |
File Name | Filename to assign to the uploaded document when using binary data. |
Output
The output JSON contains the response from the Bale Messenger API after sending the document. It typically includes details about the sent message such as message ID, chat ID, date, and document metadata.
No binary output is produced by this operation.
Example output structure (simplified):
{
"message_id": 123,
"chat": {
"id": "chatId"
},
"date": 1610000000,
"document": {
"file_name": "example.pdf",
"mime_type": "application/pdf",
"file_id": "abc123"
}
}
Dependencies
- Requires an active Bale Messenger API token credential configured in n8n.
- Uses the official Bale Messenger Bot API endpoint at
https://tapi.bale.ai/bot
. - Supports uploading files from binary data available in the workflow input or referencing existing files by their Bale server file IDs.
Troubleshooting
File Upload Issues:
Ensure the binary property name matches exactly the name of the binary data field in the input. Also verify the binary data is properly loaded into the node input.Invalid Chat ID:
The chat ID must be valid and accessible by the bot. Invalid or unauthorized chat IDs will cause errors.Caption Length:
Captions longer than 1024 characters may be rejected by the API.Reply Markup Misconfiguration:
Incorrectly structured reply markup objects can cause the API to reject the message. Use the provided UI options to configure keyboards properly.API Errors:
Errors returned from the Bale Messenger API are included in the node output under error fields. Check the error message and ensure the API token has sufficient permissions.
Links and References
- Bale Messenger Bot API Documentation (official API docs)
- n8n Documentation - Working with Binary Data
- Telegram Bot API (similar concepts) (for conceptual reference)