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*
Tripo AI
AI-powered 3D model generator from images and text.
APIMart
AI API, 99.9% SLA. Your AI, Always On.
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.
ace.me
Your new website, email address & cloud storage. Simple. Fast. Secure.
Gobii
Hire AI employees that automate your web workflows — built on a production-grade platform that runs 24/7 without the maintenance headaches.
Verdent
Build Your Product With Plain Words In Minutes
Topview AI
#1 Marketing Video Agent - Turn Your Product Into Viral Videos
AdsCreator.com
AI Ad Creation Tool - Just Paste your Website URL & get Professional AI Ads
Typecast
AI voice generator and content creation tool with realistic AI voices and avatars.
Tokenhot
Unified LLM API gateway for 100+ models with up to 90% cost savings.
AI Hairstyle Changer
Virtually try on 100+ AI hairstyles and hair colors from your photo — results in seconds, no sign-up needed.
Demi AI
Proactive AI assistant for sales professionals to automate emails, scheduling, and deal prioritization.
NewsBang
AI-powered news platform providing summaries, insights, and interactive podcasts.
PaioClaw
Managed, secure platform for deploying and automating OpenClaw AI assistants in 60 seconds.
Decksy
AI presentation maker that creates researched, professional slides from topics, text, or uploaded documents.
Seko
Advanced AI video generation platform with multi-episode workflow capabilities.
BeautyPlus
Free AI photo editor with filters, image generation, video enhancement, and more.
Free
Maxworker.ai
Max is an AI coworker for your team inside Slack. He connects to 25+ essential work tools today, with 3,000+ tools coming soon, and turns your team’s context into ready-to-review work. Fixed price, no surprise.
Kollavo - Get Cited in AI Search | $99/mo Managed Service
To show up in the answer, you need to be in the source.
ezsub
Unbeatable Price! Get ChatGPT Plus for only $12.95 with NO credit card required. Smooth local payments for global users.