Generate professional, custom PDF invoices instantly using a powerful n8n workflow triggered by a webhook. Learn how this n8n template uses custom code and PDF tools for billing automation.
Download this n8n workflow template and start using it instantly.
This solution provides a seamless, headless method for billing systems or e-commerce platforms to generate structured PDF invoices on demand. Instead of relying on expensive third-party PDF services, this n8n template uses a specialized PDF Toolkit n8n node (from CustomJS) for high-quality HTML-to-PDF conversion. The entire n8n workflow is initiated by an external Webhook n8n trigger, which receives the necessary transaction data. A crucial step involves the Code n8n node, which expertly preprocesses the raw JSON data, calculates line item totals and the grand total, and generates the necessary HTML structures for the table and addresses. This powerful and custom approach simplifies complex financial document generation tasks within your existing n8n automation infrastructure, ensuring fast, accurate, and professional output.
The creation of the PDF invoice follows a clear, automated pipeline within the n8n workflow:
) elements for all line items and wraps the address lines in tags, preparing the data for the final HTML template injection.
- PDF Generation: The 'HTML to PDF' n8n node uses the CustomJS PDF Toolkit to take a comprehensive, internally defined HTML template (which includes CSS styling) and substitutes the data outputs from the previous Code n8n node (totals, addresses, item details).
- Workflow Completion: The resulting binary PDF file is then passed to the 'Respond to Webhook' n8n node, which immediately returns the file directly as the response to the initial API call, completing the high-speed, on-demand n8n workflow execution.
Installation Guide
To deploy this n8n workflow template, follow these steps:
- Import: Copy the provided JSON code and paste it into your n8n instance using the 'New' menu -> 'Import from JSON'.
- Custom Node Installation: This n8n workflow requires the
@custom-js/n8n-nodes-pdf-toolkit community n8n node. Install it via the n8n interface (Settings -> Community Nodes).
- Credential Setup: The 'HTML to PDF' n8n node requires credentials for the CustomJS API. Ensure you have set up these credentials in your n8n instance.
- Webhook Activation: Activate the 'Webhook' n8n trigger node to expose its URL. You will use this URL in your external system to trigger the invoice generation.
- Customization: Review the JavaScript in the 'Preprocess' n8n node and the HTML in the 'HTML to PDF' n8n node to match your specific data structure and branding requirements.
Node Details
Webhook (n8n trigger): Initiates the n8n workflow upon receiving an external POST request. It is configured to respond with the output of a subsequent node, ensuring the client receives the PDF directly.
Set data (n8n node): Acts as a placeholder for the structured invoice input data (Invoice No, Bill To, From, Details array). In a live n8n workflow, this would be replaced by the data coming directly from the Webhook.
Preprocess (Code n8n node): Essential for transforming raw data. It calculates the final total and formats the list of line items and addresses into correct HTML snippet strings, making the data ready for display in the PDF template.
HTML to PDF (@custom-js/n8n-nodes-pdf-toolkit n8n node): The core document generation tool. It renders a complex, styled HTML document using data passed from the Code node, generating a binary PDF file as output.
- Respond to Webhook (n8n node): Takes the binary PDF output from the 'HTML to PDF' n8n node and returns it as the HTTP response to the original n8n trigger request.
Google Sheets Invoice Generator using PDF.co PII-Safe Help Documentation Generator from Support Chats using GPT
Related n8n Workflows
Google Sheets Invoice Generator using PDF.co
Automate PDF invoice creation directly from Google Sheets data using this powerful n8n workflow. Perfect for small businesses needing reliable, automated PDF generation.
by rbreen 0 0
Asynchronous AI Generation Using Replicate Polling Loop
Use this comprehensive n8n workflow to automate content generation with the jfirma1/test_model on Replicate. This n8n template includes a custom polling loop for reliable results.
by yaron-nofluff 0 0
AI Content & Image Generation with Human Approval for Social Media Posting
Automate content creation for social media posts using this n8n workflow. It generates images via Nano Banana, crafts tweet text with OpenAI, seeks Telegram approval, and posts to X.
by sulieman-said 0 0
PII-Safe Help Documentation Generator from Support Chats using GPT
Use this powerful n8n workflow to automatically convert Crisp support chat transcripts into sanitized, PII-safe help documentation using the OpenAI GPT model. Ideal for knowledge base management.
by cooper 0 0
Generate Product Requirements Documents (PRDs) and Test Scenarios with AI
Use this powerful n8n workflow to automatically generate professional Product Requirements Documents (PRDs) and Gherkin-style test scenarios using GPT-4 and Claude via OpenRouter, then export the final output as a PDF.
by alokkumar 0 0
Created by
Featured*
APIMart
AI API, 99.9% SLA. Your AI, Always On.
Agentkit
AI agents trained on business content for support, lead capture, and automation
Tripo AI
AI-powered 3D model generator from images and text.
Skild Art
一站式 AI 视觉创作平台,为商业营销而生
Happy Shrimp Music
AI platform for generating complete songs from text prompts
Anathema AI
▎ Anathema is an AI chat platform built around Lexi, an assistant with personality. She is bubbly, a little aloof, gives you a straight answer, and does not hedge everything into uselessness. Alongside chat, Anathema includes a full generation Studio for images, video, music and voice, running state of the art models. An API is available for Lexi and Ana.
Oakleaf 3D
AI tool for converting images into 3D-printable STL models
ScholarSail
Connected AI study workspace for flashcards, mind maps, memory palaces, and focused planning
ThumbnailCreator.com
AI tool for creating stunning YouTube thumbnails quickly.
Wondershare Filmora
AI video editor with tools for all skill levels and creative assets.
Mailmodo AI
Complete Email Marketing Automation With AI Agents
Kumoo
Professional AI Portrait Retouching
Rekam AI-Your One-Stop Voice Creation Platform
All-in-one AI voice creation platform for text-to-speech, voice clone, and speech-to-text.
KiloClaw
Managed hosting for OpenClaw. Set up OpenClaw in seconds.
AdsCreator.com
AI Ad Creation Tool - Just Paste your Website URL & get Professional AI Ads
Tokenhot
Unified LLM API gateway for 100+ models with up to 90% cost savings.
NewsBang
AI-powered news platform providing summaries, insights, and interactive podcasts.
Emporia Research
A platform connecting researchers with LinkedIn verified B2B & Healthcare participants for high-quality data collection.
Get Simple Chat
Get Simple Chat is a no-code AI chatbot platform for any website. Pick from 52 industry templates, upload your knowledge base, and embed a one-line snippet — live in 5 minutes. Replies in 80+ languages, 4 selectable AI models, white-label for agencies.
iDox.ai Guardrail
Real-time AI guardrails that prevent sensitive data exposure in AI tools, copilots, and autonomous AI agents.