Fixing frequent n8n errors
Authentication errors
Invalid API key
Error message:
401 Unauthorized - Invalid API key
Solution:
Go to your PDFMonkey dashboard
Navigate to Account → API
Copy your API key
In n8n, update your PDFMonkey credentials with the correct key
Test the connection
Expired credentials
If your credentials suddenly stop working:
Delete the old credentials in n8n
Create new credentials with a fresh API key
Update all nodes using those credentials
Document generation errors
Template not found
Error message:
404 Not Found - Template does not exist
Causes:
Template was deleted
Wrong workspace/API key
Template ID is incorrect
Solution:
Verify the template exists in your PDFMonkey dashboard
Check you're using the correct API key
Re-select the template from the dropdown in n8n
Template not published
Error message:
422 Unprocessable Entity - Template is not published
Solution:
Go to your template in PDFMonkey
Make sure it's published (click Publish button)
Try generating again
Common mistake
This is one of the most frequent errors! Always remember to publish your template after making changes.
Invalid payload data
Error message:
422 Unprocessable Entity - Invalid payload
Causes:
Invalid JSON syntax (when using JSON mode)
Wrong data types
Missing required fields
Solution for JSON mode:
Check your JSON syntax is valid. Common issues:
Missing quotes:
// ❌ Wrong
{ name: "John" }
// ✅ Correct
{ "name": "John" }
Trailing commas:
// ❌ Wrong
{
"name": "John",
"age": 30,
}
// ✅ Correct
{
"name": "John",
"age": 30
}
Unescaped quotes:
// ❌ Wrong
{ "name": "John "The Rock" Doe" }
// ✅ Correct
{ "name": "John \"The Rock\" Doe" }
Using n8n expressions in JSON:
When using n8n expressions, make sure to stringify objects:
// ❌ Wrong - Will create invalid JSON
{
"items": {{ $json.items }}
}
// ✅ Correct - Properly stringify
{
"items": {{ JSON.stringify($json.items) }}
}
// ✅ Even better - Use Key-Value mode instead
Pro tip: Use Key-Value Pairs mode
If you're struggling with JSON syntax, switch to Key-Value Pairs mode. n8n will handle all the escaping and formatting automatically.
Download errors
Download URL expired
Error message:
403 Forbidden - Download URL has expired
Cause: Download URLs expire after 1 hour for security reasons.
Solutions:
Option 1: Use Get Document
1. PDFMonkey - Get Document (gets fresh URL)
2. HTTP Request - Download from new URL
Option 2: Download immediately Enable Download File option in the Generate Document node to download immediately after generation.
Option 3: Store binary data If you need the PDF later, store the binary data in a file storage service (Google Drive, S3, etc.) instead of relying on PDFMonkey URLs.
Binary data not available
Error: No binary data available for attachment or storage.
Solution: Make sure Download File is enabled:
In Generate Document operation: Additional Options → Download File
In PDFMonkey Trigger: Additional Options → Download File
Or use a Download File operation explicitly
Webhook trigger issues
Webhook not receiving events
Checklist:
✅ Workflow is activated (not just saved)
✅ Webhook URL is correct in PDFMonkey
✅ Using Production URL not Test URL
✅ Template is published
✅ Firewall isn't blocking requests
To debug:
In n8n, check Executions tab for errors
In PDFMonkey dashboard, go to template settings → Webhooks → Check delivery logs
Try generating a test document manually
Receiving duplicate webhook events
This is expected behavior. PDFMonkey webhooks use at-least-once delivery, meaning you might receive the same event multiple times.
Solution: Make your workflow idempotent by checking if you've already processed a document:
1. PDFMonkey Trigger
2. Postgres - Check if document ID exists
3. IF node
- Already processed: Stop
- New document: Continue processing
Wrong webhook URL
After activating your workflow, the webhook URL changes from Test to Production.
Solution:
Activate your n8n workflow
Copy the Production URL from the trigger node
Update the webhook URL in your PDFMonkey template
Save the template
Expression errors
Cannot read property of undefined
Error message:
Cannot read property 'field' of undefined
Cause: Trying to access data that doesn't exist from a previous node.
Solutions:
Check the node name:
// ❌ Wrong node name
{{ $node["PDFmonkey"].json.id }}
// ✅ Correct node name
{{ $node["PDFMonkey"].json.id }}
Check the data exists:
// ❌ Assumes field exists
{{ $json.customer.email }}
// ✅ Use optional chaining (n8n 1.0+)
{{ $json.customer?.email }}
// ✅ Or provide default value
{{ $json.customer?.email || '[email protected]' }}
Use the expression editor: In n8n, click the Expression button and use the autocomplete to ensure you're referencing the correct fields.
Workflow execution errors
Workflow timeout
Error: Workflow execution timed out.
Causes:
Document taking too long to generate
Network issues
Large file downloads
Solutions:
Option 1: Increase timeout In workflow settings → Execution Timeout → Increase the value
Option 2: Disable "Wait for Document"
1. Generate Document (Wait: disabled)
2. Use webhook trigger in a separate workflow
Option 3: Split into multiple workflows Use webhooks to chain workflows together instead of one long workflow.
Memory errors
Error: JavaScript heap out of memory
Cause: Processing very large files or data in n8n.
Solutions:
Process items in smaller batches (use Split In Batches node)
Use streaming where possible
Increase n8n memory allocation (self-hosted only)
Store large files externally instead of passing through workflow
Rate limiting
Too many requests
Error message:
429 Too Many Requests - Rate limit exceeded
Solution: Add Wait nodes between operations when processing multiple documents:
1. Get items to process
2. Split In Batches (size: 10)
3. Wait (5 seconds)
4. PDFMonkey - Generate Document
5. Loop
Or use the Function node to add delays:
// Wait 1 second per item
await new Promise(resolve => setTimeout(resolve, 1000));
return items;
JSON formatting issues
Line breaks in JSON
JSON doesn't support raw line breaks in strings.
Problem:
{
"description": "Line 1
Line 2"
}
Solution:
{
"description": "Line 1\nLine 2"
}
Or use a Code node to escape:
items[0].json.description = items[0].json.description.replace(/\n/g, '\\n');
return items;
Special characters
Problem:
{
"html": "<div class="test">Hello</div>"
}
Solution:
{
"html": "<div class=\"test\">Hello</div>"
}
Or better yet, use Key-Value Pairs mode which handles escaping automatically.
Need more help?
If you're still experiencing issues:
Check n8n documentation: docs.n8n.io
Check PDFMonkey status: status.pdfmonkey.io
n8n Community: community.n8n.io
Contact PDFMonkey support: [email protected]
Related articles
Document generation options in n8nReacting to generated documents in n8nTroubleshootingLast updated
Was this helpful?