Skip to main content

n8n Integration Guide

Learn how to integrate PDFBolt with n8n to automate PDF generation in your workflows. Generate professional documents from templates, HTML content, or web pages using n8n's visual workflow builder.

Prerequisites

Before starting, ensure you have:

  1. PDFBolt API Key
  • Sign up or log in to your PDFBolt account.
  • Navigate to API Keys section.
  • Copy your API key for authentication.
  1. n8n Access
  • n8n cloud account or self-hosted instance.

Basic Setup

Configure HTTP Request Node

Use n8n's HTTP Request node to call the PDFBolt API:

  1. Add an HTTP Request node to your workflow.

  2. Configure authentication:

  • Method: POST
  • URL: https://api.pdfbolt.com/v1/direct
  • Authentication: Generic Credential Type
  • Generic Auth Type: Header Auth
  1. Create authentication credential:
  • Name: API-KEY
  • Value: YOUR-API-KEY
n8n HTTP Request node authentication setup for PDFBolt API integration
  1. Configure request body:
  • Send Body: Enabled
  • Body Content Type: JSON
  • Specify Body: Using JSON
n8n HTTP Request node basic configuration with method, URL and authentication type

Choose Your Endpoint

Select the PDFBolt endpoint based on your workflow needs:

EndpointBest ForReturns
/v1/directImmediate PDF deliveryRaw PDF data in response
/v1/syncURL-based accessJSON with download URL
/v1/asyncHigh-volume processingWebhook callback with results
Endpoint Details

See API Endpoints for detailed specifications.

Choose Your Source

Select the content source that best fits your use case:

SourceBest ForWhen to Use
TemplatesRecurring documents with consistent layoutsInvoices, contracts, certificates – any document you generate repeatedly with different data
HTMLCustom documentsWhen you need full control over a unique layout
URLExisting web pagesArchiving documentation, reports, capturing dashboards, saving public web content
Source Parameters

Learn more about source parameters in the API Documentation.

Source 1: Templates

Templates provide the most efficient way to generate consistent, branded PDFs by separating design from data.

How It Works

  1. Create your template in PDFBolt's Template section:
  • Build custom layouts with HTML, CSS, and Handlebars variables.
  • Or start with a ready-made template from the gallery.
  1. Publish the template to make it available via API and get your unique templateId.

  2. Send API request with only templateId and templateData.

  3. Receive your PDF – PDFBolt merges the data with your template and returns the generated PDF.

Template Setup

Learn how to create and manage templates in the Templates Documentation.

Example: Invoice Generation

Real-world scenario: Customer places an order in your e-commerce system. Automatically generate a professional invoice PDF and send it to the customer.

n8n HTTP Request Configuration:

If your workflow is triggered by a webhook, paste this expression into the JSON body field of the HTTP Request node:

{{ $json.body.toJsonString() }}
n8n HTTP Request body configuration for PDFBolt API
How It Works
  • $json.body – Accesses the data received from the webhook.
  • toJsonString() – Converts the object into JSON string format.
  • Result: PDFBolt receives the data in the correct structure for template processing.

Expected example webhook payload:

{
"templateId": "your-template-id",
"templateData": {
"invoice_number": "INV-2025-001",
"client_name": "John Doe",
"line_items": [
{
"quantity": "1",
"tax_rate": "10",
"unit_price": "1200.00",
"description": "Website Design",
"total_amount": "1200.00"
},
{
"quantity": "2",
"tax_rate": "10",
"unit_price": "250.00",
"description": "Logo Design Package",
"total_amount": "500.00"
}
],
"total_amount": "1700.00"
}
}

Template Workflow Example

n8n HTTP Request node example configuration for PDFBolt API integration

Complete workflow:

  1. Webhook – Receives order data from your system.
  2. HTTP Request (PDFBolt) – Generates invoice PDF.
  3. Send Message – Sends PDF to customer.
Data Mapping

Field names in templateData must exactly match Handlebars variables in your template. Mismatched names result in empty values.

Source 2: HTML

Convert HTML directly into PDFs – perfect for custom documents, event programs, announcements, or guides.

How It Works

  1. Prepare HTML content in your workflow.
  2. Base64 encode the HTML.
  3. Send encoded HTML to PDFBolt.
  4. Receive generated PDF.

Example: Event Program

Real-world scenario: Organizing a webinar or conference. Generate a PDF program with schedule, speakers, and session details that attendees can download.

  1. Add a Code node after your event registration trigger:
View Complete Code Example
// Static event program HTML – same for all attendees
const htmlContent = `
<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: Arial; color: #333; line-height: 1.6; }
.header {
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
color: white;
padding: 30px;
text-align: center;
}
h1 { margin: 0; font-size: 28px; }
.event-info {
background: #f8fafc;
padding: 20px;
border-radius: 8px;
margin: 20px 0;
}
.session {
border-left: 4px solid #6366f1;
padding: 15px;
margin: 15px 0;
background: #fff;
box-shadow: 1px 1px 10px rgba(0,0,0,0.1);
page-break-inside: avoid;
}
.time {
color: #6366f1;
font-weight: bold;
font-size: 14px;
}
.speaker {
color: #64748b;
font-style: italic;
margin-top: 5px;
}
.break {
background: #fef3c7;
padding: 10px;
text-align: center;
margin: 15px 0;
border-radius: 4px;
}
</style>
</head>
<body>
<div class="header">
<h1>Tech Summit 2025</h1>
<p>Building the Future Together</p>
<p style="margin-top: 10px; font-size: 14px;">November 15, 2025 | Virtual Event</p>
</div>

<div class="event-info">
<strong>Event Details:</strong><br>
Date: November 15, 2025<br>
Time: 9:00 AM – 5:00 PM EST<br>
Platform: Zoom (link will be sent via email)
</div>

<h2>Event Schedule</h2>

<div class="session">
<div class="time">9:00 AM – 9:30 AM</div>
<strong>Opening Keynote: The Future of AI</strong>
<div class="speaker">Speaker: Dr. Sarah Johnson, AI Research Director</div>
<p>Exploring emerging trends in artificial intelligence and their impact on business.</p>
</div>

<div class="session">
<div class="time">9:45 AM – 10:30 AM</div>
<strong>Workshop: Building Scalable APIs</strong>
<div class="speaker">Speaker: Mike Chen, Senior Engineer</div>
<p>Hands-on session covering best practices for API design and implementation.</p>
</div>

<div class="break">☕ Coffee Break (10:30 AM – 11:00 AM)</div>

<div class="session">
<div class="time">11:00 AM – 11:45 AM</div>
<strong>Panel Discussion: Cloud Architecture</strong>
<div class="speaker">Panelists: Various industry experts</div>
<p>Interactive discussion about modern cloud infrastructure and DevOps practices.</p>
</div>

<div class="session">
<div class="time">12:00 PM – 1:00 PM</div>
<strong>Networking Session</strong>
<p>Connect with other attendees and speakers in breakout rooms.</p>
</div>

<div class="break">🍽️ Lunch Break (1:00 PM – 2:00 PM)</div>

<div class="session">
<div class="time">2:00 PM – 2:45 PM</div>
<strong>Case Study: Digital Transformation Success</strong>
<div class="speaker">Speaker: Lisa Martinez, CTO</div>
<p>Real-world example of successful digital transformation journey.</p>
</div>

<div class="session">
<div class="time">3:00 PM – 4:00 PM</div>
<strong>Q&A with Speakers</strong>
<p>Ask questions and get insights from all our speakers.</p>
</div>

<div style="margin-top: 30px; padding-top: 20px; border-top: 2px solid #e2e8f0; text-align: center; color: #64748b;">
<p><strong>Questions?</strong> Contact us at events@example.com</p>
</div>
</body>
</html>
`;

// Encode to base64
const base64Html = Buffer.from(htmlContent).toString('base64');

return {
json: {
html: base64Html
}
};
HTML Encoding

HTML must be Base64 encoded before sending to PDFBolt. Use Buffer.from(html).toString('base64') in Code nodes.

  1. In the HTTP Request node body, configure PDF settings:
{
"html": "{{ $json.html }}",
"format": "A4",
"printBackground": true,
"margin": {
"top": "30px",
"bottom": "30px",
"right": "30px",
"left": "30px"
}
}
n8n HTTP Request node with HTML and PDF parameters

HTML Workflow Example

n8n workflow for sending event program to attendees

Complete workflow:

  1. Typeform Trigger – New registration form submitted.
  2. Code Node – Generate event program (Base64-encoded HTML content).
  3. HTTP Request (PDFBolt) – Generate a PDF.
  4. Gmail – Send confirmation email with PDF program to the attendee.
PDF Customization

By separating PDF settings into the HTTP Request body, you can easily adjust format, margins, and other options without modifying the HTML code. See Conversion Parameters for all available options.

Source 3: URL

Generate PDFs from any publicly accessible webpage, perfect for archiving web content, capturing dashboards, or generating reports.

How It Works

  1. Provide the target URL.
  2. PDFBolt loads and renders the page.
  3. Returns PDF of the rendered page.

Example: Daily Dashboard Report

Real-world scenario: Your team uses an analytics dashboard. Every morning, automatically capture the dashboard as PDF and share it on Slack so the team stays informed.

In the HTTP Request node body, configure the URL and PDF settings:

{
"url": "https://analytics.yourcompany.com/dashboard",
"format": "A4",
"landscape": true,
"printBackground": true,
"waitUntil": "networkidle",
"margin": {
"top": "20px",
"right": "20px",
"bottom": "20px",
"left": "20px"
}
}
n8n HTTP Request node configuration for URL to PDF dashboard report
Wait for Page Load

Use waitUntil: "networkidle" to ensure all dashboard charts and data finish loading before capturing the PDF. For pages with specific loading indicators, use waitForSelector instead.

URL Workflow Example

n8n workflow for daily dashboard report to Slack

Complete workflow:

  1. Schedule Trigger – Every weekday at 8:00 AM.
  2. HTTP Request (PDFBolt) – Capture dashboard as PDF.
  3. Slack – Shares report with team.
  4. Google Drive – Archives PDF.

Additional Resources

PDFBolt Documentation

n8n Resources