Fixing frequent n8n errors

Authentication errors

Invalid API key

Error message:

401 Unauthorized - Invalid API key

Solution:

  1. Navigate to AccountAPI

  2. Copy your API key

  3. In n8n, update your PDFMonkey credentials with the correct key

  4. Test the connection

Multiple workspaces

If you have multiple PDFMonkey workspaces, make sure you're using the API key from the correct workspace.

Expired credentials

If your credentials suddenly stop working:

  1. Delete the old credentials in n8n

  2. Create new credentials with a fresh API key

  3. 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:

  1. Verify the template exists in your PDFMonkey dashboard

  2. Check you're using the correct API key

  3. Re-select the template from the dropdown in n8n

Template not published

Error message:

422 Unprocessable Entity - Template is not published

Solution:

  1. Go to your template in PDFMonkey

  2. Make sure it's published (click Publish button)

  3. Try generating again

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

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:

  1. ✅ Workflow is activated (not just saved)

  2. ✅ Webhook URL is correct in PDFMonkey

  3. ✅ Using Production URL not Test URL

  4. ✅ Template is published

  5. ✅ Firewall isn't blocking requests

To debug:

  1. In n8n, check Executions tab for errors

  2. In PDFMonkey dashboard, go to template settings → Webhooks → Check delivery logs

  3. 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:

  1. Activate your n8n workflow

  2. Copy the Production URL from the trigger node

  3. Update the webhook URL in your PDFMonkey template

  4. 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:

  1. Process items in smaller batches (use Split In Batches node)

  2. Use streaming where possible

  3. Increase n8n memory allocation (self-hosted only)

  4. 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:

  1. Check n8n documentation: docs.n8n.io

  2. Check PDFMonkey status: status.pdfmonkey.io

  3. n8n Community: community.n8n.io

  4. Contact PDFMonkey support: [email protected]

Include details in support requests

When asking for help, include:

  • Error message (full text)

  • n8n version

  • Workflow screenshot

  • Steps to reproduce

Document generation options in n8nReacting to generated documents in n8nTroubleshooting

Last updated

Was this helpful?