Actions89
- Direct API Actions
- CRM Actions
- Task Actions
- User Actions
- SPA Actions
- Activity Actions
- Automation Actions
- Document Generator Actions
- Data Storage Actions
- Chat Actions
Overview
The "Generate Document" operation of the Bitrix24 node's Document Generator resource allows users to create documents based on predefined templates within the Bitrix24 platform. By providing a template ID and JSON data, this operation generates a document in various formats such as PDF, DOCX, or HTML. This is particularly useful for automating the creation of contracts, invoices, reports, or any standardized documents that require dynamic data insertion.
Practical examples:
- Automatically generate a sales contract PDF by filling in customer and deal details.
- Create an invoice document in DOCX format using billing data.
- Produce HTML reports from CRM data for web display or email content.
Properties
| Name | Meaning |
|---|---|
| Authentication | Method used to authenticate with Bitrix24: OAuth2 (recommended), Webhook (simpler), or API Key. |
| Template ID | The unique identifier of the document template to use for generation. |
| Generate Data | JSON-formatted data that populates the template fields during document generation. |
| Options | Additional optional settings: |
| - File Name | Custom name for the generated document file. |
| - Format | Output format of the generated document. Options: PDF, DOCX, HTML. |
| - Access Token | Optional access token string for authentication purposes. |
Output
The node outputs a JSON object representing the generated document. The structure typically includes metadata about the document and the generated content. If the document is binary (e.g., PDF or DOCX), it will be available in the binary output field, allowing further processing or saving.
json: Contains metadata and information about the generated document.binary: Contains the actual document file data in the specified format.
Dependencies
- Requires connection to Bitrix24 services via one of the supported authentication methods (OAuth2, webhook URL, or API key).
- Proper configuration of credentials in n8n is necessary to authenticate API calls.
- The node relies on Bitrix24's document generation API endpoints.
Troubleshooting
Common issues:
- Invalid or missing Template ID: Ensure the template exists and the ID is correct.
- Incorrect JSON data format: Validate the JSON input matches the expected template fields.
- Authentication failures: Verify credentials and tokens are valid and have sufficient permissions.
- Unsupported output format: Confirm the selected format is among PDF, DOCX, or HTML.
Error messages:
- Errors related to API call failures usually indicate network issues or invalid credentials.
- JSON parsing errors suggest malformed input data.
- Template not found errors mean the provided Template ID does not exist or is inaccessible.
Resolving these typically involves checking credentials, validating inputs, and ensuring the template is correctly set up in Bitrix24.