Actions28
- Conversion Actions
- Document Actions
- PDF Service Actions
- Template Actions
- Workspace Actions
Overview
This node integrates with a PDF generation and management API, providing multiple PDF-related operations such as generating PDFs from templates or HTML/URLs, managing documents and templates, processing existing PDFs (watermarking, encryption, form filling), and workspace management.
Specifically for the Template - Validate operation, the node validates a given PDF template configuration JSON. This is useful to ensure that your template JSON structure is correct and accepted by the PDF generation service before attempting to create or update templates or generate documents from them.
Common scenarios:
- Validating complex template JSON configurations during development to catch errors early.
- Automating template validation in workflows before deploying or updating templates.
- Ensuring template JSON correctness when dynamically generating or modifying templates programmatically.
Example:
You provide a JSON object describing your PDF template layout, pages, data settings, and editor options. The node sends this JSON to the API's validation endpoint and returns whether the template is valid or details about any issues found.
Properties
| Name | Meaning |
|---|---|
| Template Configuration JSON | The full JSON object representing the template configuration to validate. Must include keys like name, layout, pages array, dataSettings, and editor. Example structure is provided in the property description. |
Output
The output JSON contains the response from the API validation endpoint. Typically, it will indicate success or failure of the validation and may include error messages or warnings if the template JSON is invalid or incomplete.
Output example structure (simplified):
{
"success": true,
"message": "Template configuration is valid."
}
or on error:
{
"success": false,
"errors": [
"Missing required field 'layout.format'",
"Page dimensions must be positive numbers"
]
}
No binary data output is involved in this operation.
Dependencies
- Requires an API key credential for the PDF Generator API service.
- The node makes authenticated HTTP requests to the PDF Generator API base URL (default:
https://us1.pdfgeneratorapi.com/api/v4). - No additional environment variables are needed beyond the API credential.
Troubleshooting
- Invalid JSON input: If the provided template configuration JSON is malformed or not a valid JSON object, the node throws an error indicating the JSON must be valid.
- Missing required fields: The API may reject the template if essential fields like
name,layout,pages,dataSettings, oreditorare missing or incorrectly structured. - API errors: Network issues or invalid API credentials will cause request failures; ensure the API key is correctly configured.
- Error message:
"Template configuration must be a valid JSON object"— occurs if the input is not parseable JSON or not an object. - Error message:
"The operation "validate" is not supported for resource "template"— indicates a misconfiguration or unsupported operation/resource combination.
To resolve:
- Double-check the JSON syntax and structure against the expected template schema.
- Verify API credentials and network connectivity.
- Use the example JSON provided in the property default as a starting point.
Links and References
- PDF Generator API Documentation (general reference for API endpoints and template JSON structure)
- n8n Documentation on Custom Nodes (for understanding node implementation concepts)
Summary
This node's Template - Validate operation allows users to verify their PDF template JSON configurations against the PDF Generator API's validation rules, helping prevent errors in document generation workflows by ensuring templates are well-formed and compliant before use.