Skip to Content
n8n

n8n

Render a PDF or image from an oJo template in any n8n workflow, with the HTTP Request node and your API key. There is no oJo node to install.

Before you start

1. Add your API key to n8n

Create a credential of type Header Auth:

FieldValue
NameAuthorization
ValueBearer <your API key>

2. Paste the node

Copy this and paste it on your workflow canvas with Ctrl+V (Cmd+V on a Mac):

{ "nodes": [ { "parameters": { "method": "POST", "url": "https://api.ojo.so/v1/pdf/template", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendBody": true, "specifyBody": "json", "jsonBody": "={{ JSON.stringify({ templateId: '<Template ID>', modify: { invoice: { number: $json.number }, customer: { name: $json.customer } } }) }}", "options": {} }, "name": "oJo: render PDF", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [0, 0] } ], "connections": {} }

Then open the node, pick your Header Auth credential, connect it after the step that holds your data, and edit the body:

  • Replace <Template ID> with your template’s ID.
  • Shape modify like your template’s variables. $json.number reads the field number from the step before. get_template or Get Template lists every field a template reads.

The body is one JSON.stringify expression, so quotes and line breaks in your data stay valid JSON.

For a PNG, use https://api.ojo.so/v1/image/template with the same body. The response then holds imageUrl. See Create Image from Template.

3. Use the file

The node returns the JSON response. pdfUrl has no scheme, so later nodes use https://{{ $json.pdfUrl }}. Send it in an email or a Slack message, or fetch it with a second HTTP Request node set to Response Format: File to attach the PDF itself.

When it fails

StatusMeaning
400The body is not valid JSON.
401The credential’s value is not Bearer followed by a valid key.
402Out of credits.
422The request was refused before rendering, for example a missing templateId. The message says why.
429Too many requests. Add a Wait node or batch the items.

Tested with n8n 2.44.7. Want an oJo node in n8n’s list instead? Tell us.