In many organizations, client-facing documents such as invoices, quotes, and certificates are critical touchpoints. Unfortunately, these documents are often generated by legacy systems that produce inconsistent, poorly formatted, or unbranded PDFs. The result? A lack of professionalism, wasted time fixing documents, and a negative client experience.
By combining the power of n8n for workflow automation, Gotenberg for high-quality PDF rendering, and Docker for containerization, this system ensures that every document delivered to a client is clean, consistent, and trustworthy.
This project is a homelab implementation of a real-world automation I deployed in a production environment. It demonstrates how to build a scalable, automated document generation pipeline using modern open-source tools.
Step 1: An external system sends a POST request with document details (e.g., invoice items) to an n8n webhook.
Step 2: The n8n workflow receives the data and forwards it to the PHP service.
Step 3: The PHP script renders a dynamic HTML template using the provided data.
Step 4: n8n then sends the rendered HTML to the Gotenberg service for conversion.
Step 5: Gotenberg returns the final, professional PDF file, which n8n sends back as the webhook response.
Navigate to the Usage section to learn how to set up and run the system. You can also explore the Templating guide to create and customize your own document templates.
Docker Compose: To manage and run all services as a single, portable stack.
This system converts dynamic HTML/PHP templates into professional, branded PDFs, ensuring every document delivered to clients is clean, consistent, and trustworthy.