š ļø Create PDF from HTML with Gotenberg
How it works
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.
Receives Input: The workflow is triggered with a JSON object containing the full html code as a string and a desired file_name for the output. Prepares File: It converts the incoming HTML string into a binary index.html file, which is required for the API call. Calls Gotenberg API: It sends the HTML file to a running Gotenberg instance via an HTTP request. It also dynamically sets the output filename and embeds metadata (like Author, Title, and Creation Date) directly into the PDF. Returns PDF: The workflow outputs the final binary PDF file, ready to be saved, sent in an email, or used in the next step of your main workflow.
Set up steps
Setup time: ~3 minutes
This workflow has one critical prerequisite: a running Gotenberg instance that your n8n can connect to.
- 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.
- Use as a Sub-Workflow
This workflow is ready to be used as a sub-workflow.
In your main workflow, add an Execute Sub-Workflow node. In the Workflow parameter, select this "Create PDF from HTML" workflow. Provide the input data in the required format: a JSON object with html and file_name keys.
Related Templates
Instagram Full Profile Scraper with Apify and Google Sheets
šø Instagram Full Profile Scraper with Apify and Google Sheets This n8n workflow automates the process of scraping ful...
Generate Product Ad Copy & CTAs with GPT-4 for Slack and Airtable
ā” AI Copywriter Pro: Instant Ad Copy & CTA Generator Transform product details into compelling marketing copy in second...
Technology News Workflow Explanation with Key Services
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. Auto-Publish Techn...
š Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments