n8n workflow templates for ChartPNG
Four workflows that turn data into a chart image. Each one sends a Chart.js config to ChartPNG and uses only n8n's own nodes plus the app you post to. Nothing to install.
Import a template
- Download a template below, or copy its import link.
- In n8n, create a new workflow.
- On the canvas header, open the Workflow menu (the three dots).
- Choose Import from File and pick the JSON file. Or choose Import from URL and paste the import link.
- Open each node that shows a warning and pick your own credential. The files hold placeholders, no secrets.
- Replace the sample data with yours and run Execute workflow.
You can also copy the nodes and paste them into the editor. Before you share a workflow you exported, remove its credential details.
The free plan, and an optional key
The templates call https://chartpng.dev/chart with no key. That is the free plan: all chart types, a small watermark, up to 4 megapixels per image.
To remove the watermark, use a Pro key. Put it in an n8n credential, not in a header field. Exported workflows leave credentials out, but they keep any value typed into a header field.
- Open the HTTP Request node in the weekly Slack template.
- Set Authentication to Generic Credential Type.
- Set Generic Auth Type to Header Auth.
- Create a credential. Set Name to
Authorizationand Value toBearer, a space, then your key.
A few rules:
- The key goes in the header of a
POST, never in a URL. Only the weekly Slack template uses a POST. - The email, Sheets and KPI report templates put the image in a URL, so they keep the watermark. A signed URL is how a Pro image goes into a public page; these templates do not build one.
- A wrong key does not fail the request. You get the free image with the watermark.
The four templates
Weekly chart to Slack
Schedule Trigger, Code, HTTP Request, Slack
Every Monday at 9 it builds a bar chart, renders it with a POST to ChartPNG and uploads the PNG to a Slack channel.
- Open the Code node called Build chart. Replace the sample numbers with your own data.
- Open Upload to Slack. Pick your Slack credential and set the channel.
- Run the workflow once with Execute workflow. The chart should land in the channel.
- Click Publish (top right) so the schedule runs. On n8n 1.x, switch the workflow to Active instead.
https://chartpng.dev/templates/n8n/weekly-chart-to-slack.jsonWeekly KPI report to Slack
Schedule Trigger, Code, Code, Slack
Every Monday at 9 it builds two chart URLs with the report presets, a KPI with a sparkline and this week against last week, and posts one Slack message with both images.
- Open the Code node called Sample data. Replace the numbers with your own.
- Open Post to Slack. Pick your Slack credential and set the channel.
- Run the workflow once with Execute workflow. The message should land in the channel.
- Click Publish (top right) so the schedule runs. On n8n 1.x, switch the workflow to Active instead.
https://chartpng.dev/templates/n8n/weekly-kpi-report-to-slack.jsonDaily chart in an email
Schedule Trigger, Code, Send Email
Every day at 8 it builds a line chart and sends an HTML email whose body shows the chart as an image URL.
- Open Build chart and replace the sample numbers with your own data.
- Open Send email. Pick your SMTP credential and set From, To and Subject.
- Run the workflow once and check the email in Gmail or Outlook.
- Click Publish (top right) so the schedule runs. On n8n 1.x, switch the workflow to Active instead.
https://chartpng.dev/templates/n8n/daily-chart-in-email.jsonGoogle Sheets rows to a chart URL
Manual Trigger, Google Sheets, Code, HTTP Request, Google Sheets
It reads the rows of a Data tab, builds one bar chart from them and writes the image URL into a Chart tab.
- In your spreadsheet, make a tab called Data with the headers label and value. Make a second tab called Chart with the headers id and chart_url.
- Open both Google Sheets nodes. Pick your Google Sheets credential and your spreadsheet.
- Run the workflow. The Chart tab gets one row, with id latest and the image URL.
- To refresh the chart on a schedule, replace the Manual Trigger with a Schedule Trigger.
https://chartpng.dev/templates/n8n/sheets-rows-to-chart-url.jsonReport presets for Slack and email
The KPI template uses two presets, set under options.plugins.chartpng.preset. Each has a guide with its config, a GET URL and a curl example:
- KPI with a sparkline: a big number, a change chip and a trend line.
- Ranking chart: horizontal bars from highest to lowest.
- Comparison with the previous period: this week against last week, with the change in percent.
What the HTTP Request node sends
The weekly template posts JSON to https://chartpng.dev/chart. The fields are the same ones a GET takes:c is the Chart.js config, w and h are the size in pixels, dpris 1 or 2 and bkg is the background.
{
"c": { "type": "bar", "data": { "labels": ["Mon", "Tue"], "datasets": [{ "data": [12, 19] }] } },
"w": 800,
"h": 450,
"dpr": 2,
"bkg": "white"
}The node settings that matter: Method POST, Body Content Type JSON,Specify Body Using JSON, and under Options, Response withResponse Format File. The PNG lands in the field named byPut Output in Field, data by default. The Slack node reads that same field.
A bad config returns a 400 with a JSON message that says what is wrong. The config can be up to 16 KB.
Why the HTTP Request node, not the QuickChart node
n8n has a QuickChart node. It sends the chart to quickchart.io, and that address is fixed in the node. There is no field for another host, so it cannot call ChartPNG.
The HTTP Request node can call any address. It also is not limited to the chart types the QuickChart node lists (bar, doughnut, line, pie and polar): you send the whole Chart.js config. The c format matches QuickChart's, so moving a config over is a copy and paste.
Limits
- A GET URL carries the whole config, so long configs make long URLs. Past a few thousand characters, use a POST.
- Free images are up to 4 megapixels: width times height times dpr squared.
- Each distinct config is its own image, cached on a CDN. The same URL gives the same image.