Skip to content

n8n PDF GeneratorBrnaded Documents

This project is created to relolve Inconsistent, Unbranded, and Poorly Formatted PDF Generations.
Built with ❤️ by Jahid Hasan

Cover Photo

Why this Project Exists

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.



🛠 How It Works

  • 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.

Why this Project Matters

  • Professionalism: Client-facing documents are brand ambassadors. Clean and consistent PDFs build trust.
  • Automation: No more manual rework; the pipeline ensures accuracy every time.
  • Scalability: The containerized architecture can run anywhere — from homelab to enterprise.
  • Learning Value: This project demonstrates workflow automation, container orchestration, and practical business problem-solving.

⚠️ Core Challenge

  • Internal software generated low-quality PDFs with formatting issues.
  • Brand identity was inconsistent across documents.
  • Manual corrections were time-consuming and error-prone.
  • Client-facing communication suffered in quality and consistency.

✅ Proposed Solution

I designed and deployed a solution using:

  • n8n: A workflow automation platform to orchestrate data and tasks.
  • Gotenberg: A powerful service for converting HTML to PDF.
  • nginx + PHP-FPM: To serve dynamic HTML templates (invoices, quotes, certificates).
  • Cloudflare Tunnel: For secure remote access without exposing ports.
  • 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.

🚀 Outcome after Deployment

  • 100% automated PDF generation.
  • Consistent, professional branding on every document.
  • Reduced manual effort and eliminated human error.
  • The system is highly scalable and easy to maintain thanks to Docker.

Who Is This Documentation For?

  • Engineers: Interested in automation, DevOps, or document generation pipelines.
  • Students & Learners: Looking for a real-world project to practice Docker, APIs, and workflow automation.
  • Businesses & Teams: Curious about how automation can improve communication and reduce errors.