This workflow converts an HTML string into a polished PDF file using the powerful open-source Gotenberg service. It's designed to be a reusable utility in your automation stack.
html
code as a string and a desired file_name
for the output.index.html
file, which is required for the API call.Setup time: ~3 minutes
This workflow has one critical prerequisite: a running Gotenberg instance that your n8n can connect to.
1. Prerequisite: Run Gotenberg
You need to have the Gotenberg service running. The easiest way is with Docker. Add the following service to your docker-compose.yml
file (the same one you use for n8n):
services:
# ... your n8n service ...
gotenberg:
image: gotenberg/gotenberg:8
restart: always
Then, restart your stack with docker compose up -d
. This makes Gotenberg available at the address http://gotenberg:3000
from within your n8n container.
2. Use as a Sub-Workflow
This workflow is ready to be used as a sub-workflow.
html
and file_name
keys.