Actions28
- Conversion Actions
- Document Actions
- PDF Service Actions
- Template Actions
- Workspace Actions
Overview
The node integrates with a PDF generation API to asynchronously generate PDF or HTML documents from templates. It allows users to submit template IDs along with JSON data to merge into those templates, producing customized documents. The asynchronous operation means the node initiates document generation and can optionally receive a callback when the process completes, enabling workflows that handle large or time-consuming document creation without blocking.
Common scenarios include:
- Generating invoices, reports, or certificates based on dynamic data.
- Producing batch documents asynchronously for large datasets.
- Integrating document generation in automated workflows where immediate output is not required but notification upon completion is desired.
Example: A user submits a purchase order template ID and order details as JSON; the node triggers asynchronous PDF generation and receives a callback URL to notify when the PDF is ready for download or further processing.
Properties
| Name | Meaning |
|---|---|
| Template | Select the template to use for PDF generation. Can be chosen from a list or entered by template ID. |
| Data | JSON data to merge with the selected template for document generation. |
| Format | Output document format: PDF or HTML. |
| Output | Response format of the generated document: Base64 string or a URL where the document is stored for 30 days. |
| Callback Options | Collection of options for asynchronous callback: |
| - Callback URL | URL to receive a callback request when generation completes. |
| - Custom Headers | JSON object specifying custom headers to include in the callback HTTP request. |
| Additional Fields | Optional fields: |
| - Output Name | Custom name for the generated document. |
| - Testing | Boolean flag to enable testing mode (generation does not count against quota and adds a PREVIEW watermark). |
Output
The node outputs JSON data describing the result of the asynchronous document generation request. The exact structure depends on the API response but generally includes:
success: Boolean indicating if the request was accepted successfully.filename: Name of the generated document (if provided).format: Document format (pdforhtml).- Other metadata returned by the API about the generation request.
If the output option is set to Base64, the response contains the base64-encoded document content directly in JSON. If set to URL, the response includes a URL where the generated document can be accessed for up to 30 days.
No binary data is output directly in this asynchronous operation since the generation happens outside the immediate execution context.
Dependencies
- Requires an API key credential for authenticating with the external PDF Generator API service.
- The node uses the API base URL configured in the credentials or defaults to
https://us1.pdfgeneratorapi.com/api/v4. - For asynchronous operations, if a callback URL is specified, an accessible endpoint must be provided to receive HTTP callbacks from the API.
Troubleshooting
- Invalid JSON in Data or Callback Headers: The node validates JSON inputs and throws errors if invalid JSON is provided. Ensure all JSON fields are correctly formatted.
- Missing Required Parameters: Template ID and Data are mandatory. Omitting these will cause errors.
- Invalid Template ID: Template ID must be numeric if entered manually; otherwise, select from the list.
- Callback URL Issues: If a callback URL is provided but unreachable or incorrect, the asynchronous notification will fail. Verify the URL is publicly accessible and accepts POST requests.
- API Authentication Errors: Ensure the API key credential is valid and has necessary permissions.
- Output Option Mismatch: Selecting
URLoutput stores the document temporarily; ensure your workflow handles this accordingly.
Links and References
- PDF Generator API Documentation (general reference for API capabilities)
- n8n Documentation on Credentials (for setting up API authentication)
- Asynchronous Webhook Handling in n8n (for managing callback URLs)
This summary covers the "Document" resource with the "Generate (Async)" operation, focusing on input properties, output structure, dependencies, and common troubleshooting points based on static analysis of the node's source code and property definitions.