Bitrix24 icon

Bitrix24

Interact with Bitrix24 CRM and business platform

Actions290

Overview

The "Document Generator" resource with the "Generate Document" operation in this Bitrix24 node allows users to create documents based on predefined templates by supplying JSON data. This is useful for automating document creation such as contracts, invoices, reports, or any templated paperwork within Bitrix24's ecosystem.

Typical scenarios include:

  • Automatically generating PDF or DOCX contracts populated with client data.
  • Creating HTML reports from CRM data for web display or email.
  • Producing customized invoices or quotes using stored templates and dynamic input data.

This operation streamlines document generation workflows by integrating template management and data injection directly into n8n automation flows.

Properties

Name Meaning
Authentication Method of authenticating 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 will be injected into the template to generate the document content.
Options Additional optional settings:
- File Name Custom file name for the generated document.
- Format Output format of the generated document. Options: PDF, DOCX, or HTML.
- Access Token Optional access token string for authentication purposes.

Output

The node outputs a JSON object representing the generated document. The exact structure depends on the Bitrix24 API response but typically includes metadata about the created document and possibly a URL or binary data reference to download the document.

If the document is output as binary data, it represents the actual file content in the selected format (PDF, DOCX, or HTML).

Dependencies

  • Requires connection to a Bitrix24 account via one of the supported authentication methods (OAuth2, webhook URL, or API key).
  • Proper configuration of credentials in n8n for the chosen authentication method.
  • Access to the Bitrix24 Document Generator API and existing document templates identified by Template ID.

Troubleshooting

  • Invalid Template ID: If the provided Template ID does not exist or is incorrect, the API call will fail. Verify the Template ID is correct and accessible.
  • Authentication Errors: Using an invalid or expired access token or API key will cause authentication failures. Ensure credentials are valid and refreshed if needed.
  • Malformed JSON in Generate Data: The JSON data must be well-formed and match the expected structure of the template placeholders. Invalid JSON or missing required fields can cause generation errors.
  • Unsupported Format: Selecting a format other than PDF, DOCX, or HTML may result in errors. Use only supported formats.
  • API Rate Limits or Connectivity Issues: Network problems or Bitrix24 API rate limits can cause intermittent failures. Retry logic or error handling should be implemented.

Common error messages usually indicate the above issues and can be resolved by verifying inputs, credentials, and network connectivity.

Links and References

Discussion