n8n image generation with MintRender
n8n calls MintRender with its HTTP Request node. Each run sends a template id and the values from the step before, and gets the file's URL back.
Before you start
Make a template in the editor (or use one from the gallery) and publish it. Copy its id (tpl_…).
Make an API key under Account, API keys. A test key (
mr_test_…) adds a watermark and costs nothing. Use it while you build the workflow.
Import a workflow
- mintrender-render.json: one image from one set of values (
POST /v1/render). - mintrender-batch.json: one PDF per row of a Google Sheet (shared as a CSV link), with one ZIP at the end (
POST /v1/batch).
In n8n, open a new workflow and paste the file's text on the canvas, or use Import from file. Each template page in the gallery has its own n8n file with that template's fields.
Add your key
Open the MintRender node. Authentication is "Generic Credential Type", with "Header Auth".
Make a new Header Auth credential: name
Authorization, valueBearer mr_live_…(your key, with the word Bearer and a space before it).Change
YOUR_TEMPLATE_IDin the JSON body to your template's id.
Use values from earlier steps
Put n8n expressions in the body. The field names are the names you gave the layers in the editor:
{ "template": "YOUR_TEMPLATE_ID", "data": { "title": "{{ $json.title }}" }, "format": "png"}Any value type of Template data works: text, an image URL, a colour, true or false to show or hide a layer. ignore_unknown lets one body serve templates that do not have every field:
{ "template": "YOUR_TEMPLATE_ID", "data": { "title": "{{ $json.title }}", "photo": "{{ $json.image_url }}", "price": "{{ $json.price }}", "badge": {{ $json.on_sale ? true : false }} }, "format": "jpg", "sizes": ["main", "square"], "ignore_unknown": true}Use the answer
- The answer has
outputs[0].url, the file's address. In the next node, use{{ $json.outputs[0].url }}: in an email, a Slack message, a Google Sheet column or your CMS. - For the file itself as binary data, add
?inline=1to the URL and set the node's response format to File. This works for one size and a sync render. - The same values again come from the stored file, cost no credit, and say
"cached": true. - Each n8n item makes one call. The Free plan allows 30 calls a minute per key. For many items, use a batch.
Many files at once
The batch workflow calls POST /v1/batch with a CSV link (the first row names the fields). It answers at once with a batch id. Ask GET /v1/batch/{id} later, or add webhook_url with the URL of an n8n Webhook node to hear when it is done. The event's data.zip_url is a path: get https://mintrender.com plus that path with the same credential to download the ZIP. See Batches and CSV and Jobs and webhooks.
When a call fails
The HTTP Request node stops on an error status. The answer's body has error.code, error.message and error.field, like data.title when a value does not fit. The codes are on the Errors page. A 429 has a Retry-After header: wait that many seconds before the next try.
Seen MintRender used for content that breaks our terms? Report it. Questions about the API: support@mintrender.com, with the request id.