Actions21
Overview
The node "DinastiAPI AI" enables sending various types of WhatsApp messages and performing related WhatsApp operations via the DinastiAPI service. It is optimized for AI workflows and supports a wide range of message types including text, images, documents, audio, video, locations, contacts, stickers, interactive buttons, lists, polls, links, and status updates. Additionally, it can retrieve WhatsApp session status, user info, avatars, group and newsletter lists, and business profiles.
For the Send Document operation specifically, the node allows sending document files (such as PDF, DOCX, XLSX) to WhatsApp users, groups, newsletters, or LIDs with custom filenames and optional captions. Documents can be provided as binary data from previous nodes, base64 encoded strings, or URLs.
Common scenarios:
- Sharing contracts, reports, or manuals as documents in customer support chats.
- Sending invoices or receipts automatically after a transaction.
- Distributing newsletters or official documents to groups or channels.
- Automating document delivery in business workflows integrated with WhatsApp.
Properties
| Name | Meaning |
|---|---|
| Recipient | Phone number, Group ID (@g.us), Newsletter ID (@newsletter), or LID (@lid) to which the document will be sent. |
| Document Source | Method to provide the document file: - Binary Data: Use binary data from a previous node. - Base64: Provide a base64 encoded document string. - URL: Provide a direct URL to the document file. |
| Binary Property | Name of the binary property containing the document when using Binary Data source. Default is "data". |
| Base64 Document | Base64 encoded document string (required if Document Source is Base64). Should include data URL prefix like data:application/pdf;base64,.... |
| Document URL | URL to the document file (required if Document Source is URL). |
| File Name | Name of the document file to be sent (e.g., "document.pdf"). Required. |
| Caption | Optional caption text to accompany the document message. |
| Additional Options | Collection of optional parameters: - Message ID: Custom message identifier (auto-generated if omitted). - Presence Simulation: Simulate typing indicator for specified milliseconds. - Message Duration: Set disappearing message duration (No expiration, 24h, 7d, 90d). - Context Information: Reply, forward, mentions, etc. |
| Optimize Response | Whether to optimize the API response to reduce token usage and improve AI processing (tool mode only). |
| Max Response Length | Maximum characters in the response; longer responses are truncated (tool mode only, requires Optimize Response enabled). |
| Include Only Essential Fields | Whether to include only essential fields in the response to reduce noise (tool mode only, requires Optimize Response enabled). |
| Response Format | Format of the response for AI agent understanding: Optimized, Raw, or Summary (tool mode only, requires Optimize Response enabled). |
Output
The node outputs JSON data representing the API response from DinastiAPI for the send document request. The structure typically includes:
- Confirmation of message sending status.
- Metadata about the sent message such as message ID, timestamp, recipient info.
- Any error information if the sending failed.
If the node is used in tool mode with response optimization enabled, the output may be truncated or simplified to reduce size and focus on essential information for AI processing.
This node does not output binary data directly for the Send Document operation.
Dependencies
- Requires an active connection to the DinastiAPI WhatsApp messaging service.
- Needs an API key credential configured in n8n for authentication with DinastiAPI.
- For binary document sources, expects binary data to be available from previous nodes in the workflow.
- Network access to URLs if using URL-based document sources.
Troubleshooting
- Binary property not found error: Occurs if the specified binary property name does not exist in the input data. Ensure the binary data is correctly passed from previous nodes and the property name matches exactly.
- Invalid document source: If the document source option is set incorrectly or required fields (like Base64 Document or Document URL) are missing, the node will throw errors. Verify that all required inputs for the chosen source are provided.
- File name missing: The file name is mandatory for sending documents. Omitting it will cause an error.
- API request failures: Network issues, invalid API keys, or quota limits on DinastiAPI can cause request failures. Check credentials and network connectivity.
- Message not delivered: Could be due to invalid recipient format or the recipient not having WhatsApp. Validate recipient identifiers carefully.
Links and References
- DinastiAPI GitHub Repository
- WhatsApp Business API documentation (for general concepts): https://developers.facebook.com/docs/whatsapp
- n8n Documentation on Custom Nodes: https://docs.n8n.io/integrations/creating-nodes/