Overview
This node integrates with the PDFMonkey API to manage PDF documents. It supports generating PDFs from templates, retrieving document details and status, downloading generated PDFs, and deleting documents.
Common scenarios include:
- Automating PDF report generation based on dynamic data.
- Checking the status of a PDF generation job.
- Downloading completed PDFs for further processing or storage.
- Cleaning up by deleting obsolete or unwanted PDF documents.
For example, you can use this node to generate an invoice PDF from a template by providing customer data as JSON, wait for the PDF to be ready, then download it automatically.
Properties
| Name | Meaning |
|---|---|
| Document ID | The ID of the generated document. Used to get details, download, or delete a specific PDF. |
(Note: The "Document ID" property is required for the "Get Document", "Download PDF", and "Delete Document" operations.)
Output
The node outputs JSON data containing the response from the PDFMonkey API for each operation:
- Get Document: Outputs the full document object including its status and metadata.
- Download PDF: Outputs a JSON message confirming success along with the document ID, status, and filename. Also outputs binary data representing the downloaded PDF file.
- Delete Document: Outputs a JSON confirmation of successful deletion with the document ID.
- Generate Document (not requested here but related): Outputs the created document info and optionally the binary PDF if waiting for completion.
If the node downloads a PDF, the binary output field data contains the PDF file content with the appropriate filename and MIME type (application/pdf).
Dependencies
- Requires an API key credential for authenticating with the PDFMonkey API.
- Makes HTTP requests to
https://api.pdfmonkey.io/api/v1/documents. - No additional environment variables are needed beyond the API key credential configured in n8n.
Troubleshooting
- No API Key Provided: The node will throw an error if the API key credential is missing or invalid. Ensure the API key is correctly set in the node credentials.
- Document Not Ready for Download: When attempting to download a PDF, if the document status is not
"success", the node returns a warning message indicating the document is not ready. Wait and retry later. - Document Generation Failure: If document generation fails, the node logs the failure cause and outputs the failure response. Check the payload and template ID for correctness.
- Deletion Errors: If deleting a document fails, the node throws an error with the failure message. Verify the document ID and permissions.
- Network or API Errors: Any HTTP request failures will cause errors unless "Continue On Fail" is enabled, in which case errors are returned in the output JSON.