Automation
Generate images from Markdown in n8n
Add one HTTP Request node to any workflow and turn Markdown into PNG, JPG, or PDF. There is no custom node to install and no self-hosting requirement.
Why
What people build with it
Turn RSS items or database rows into social cards on a schedule, then post them to Slack, X, or LinkedIn from the same workflow.
Render the output of an AI node as an image before it leaves the workflow — Markdown goes in, a shareable PNG comes out.
Attach a rendered PDF to outbound email when a form is submitted or a record changes.
Setup
Connecting n8n
- 01
Create an API token under Profile → API tokens. It starts with mti_ and is shown only once, so copy it before closing the dialog.
- 02
In your workflow, add an HTTP Request node. Set the method to POST and the URL to https://markdowntoimage.com/api/v1/images/generate.
- 03
Under Headers, add the authorization header. n8n's Header Auth credential works too — the header name and value are the same either way.
Authorization: Bearer mti_your_token_here
- 04
Set Body Content Type to JSON and paste this. The ={{ }} expression pulls Markdown from whichever node ran before it.
{ "markdown": "={{ $json.content }}", "format": "png", "width": 800, "theme": "sunset", "mode": "url" } - 05
The image URL comes back on this path. Feed it into an upload, email, or storage node downstream.
{{ $json.data.imageUrl }}
Every parameter — themes, fonts, code styles, page size for PDF — is listed in the API reference.