> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.pdfgeneratorapi.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to integrate PDF Generator API with n8n

# From Data to Document in 5 Minutes: Your First n8n - PDF Generator API Workflow. 

The true power of automation platforms like n8n is unlocked when you connect them to specialized external services like PDF Generator API. If you've ever needed to dynamically create invoices, reports, or certificates, the PDF Generator API is an excellent tool for the job. In this tutorial, we will build a simple but practical n8n workflow that authenticates and calls the PDF Generator API Generate document action, allowing you to create custom documents automatically.

### Prerequisites

* An active **n8n instance**.
* An active **PDF Generator API account** (free [SANDBOX](https://app.pdfgeneratorapi.com/signup) account is great for getting started).
* **API Credentials:** **Workspace Identifier, API Key** and **Secret** in the PDF Generator API "[Settings](https://app.pdfgeneratorapi.com/settings)".
* A basic understanding of n8n concepts (workflows, nodes, expressions).


### The Easiest Way to Create PDFs in n8n with the Official PDF Generator API Node

#### Step 1: Downloading the PDF Generator API Node

First, we need to add the official node to your n8n instance.

1. Once at your n8n canvas, add a new node by navigating to "+" button.
2. Search for "PDF Generator API" on the right side of the canvas.
3. Select the node and click the install icon. The PDF Generator API node will be available in few seconds and ready to use.

![Installing the PDF Generator API node](https://storage.crisp.chat/users/helpdesk/website/-/1/1/e/0/11e0e518fc48ce00/screenshot-2025-10-02-at-11182_1a7253y.png)


#### Step 2: Set Your Credentials

Next, securely connect your PDF Generator API account.

1. Double-click the PDF Generator API node you just downloaded, select the **Credentials to connect with** 
2. Select **+ Create new credentials**
3. Fill in the fields with your **API Key, Secret** and **Workspace Identifier** which you can find in your PDF Generator API account settings.
4. Click **Save**.

![Credentials](https://storage.crisp.chat/users/helpdesk/website/-/1/1/e/0/11e0e518fc48ce00/image_xdpdlo.png)

### Step 3: Configure the "Generate Document" Action

With your PDF Generator API module added to the workflow, it's time to tell it exactly what to create. This step involves selecting your template and providing the data to populate it.
As shown in the image, you will configure the following parameters:

1. **Credential to connect with**: Ensure the PDF Generator account you connected in the previous step is selected here.
2. **Resource**: Set this to `Document`.
3. **Document Operations**: Choose the `Generate` option.
4. **Template**: Select the specific template you want to use from your PDF Generator API account. In the example, a template named "Certificate (ID: 1458495)" is chosen.
5. **Data**: This is the most critical part. You need to provide the dynamic content for your document in JSON format.

In this example, the following JSON data is used:

JSON
```
{
  "name": "John",
  "id": "123456",
  "role": "Developer"
}
```
 

6. **Format**: Select `PDF` as the output file format.
7. **Output**: Choose `File` to ensure the final output of this step is a usable file for the next steps in your automation (like sending an email or saving to a drive).

| Once configured, you can click "Execute step" to test it. The OUTPUT on the right shows a successful result: a document.pdf file has been generated and is ready to be used.

!["Generate Document" Action](https://storage.crisp.chat/users/helpdesk/website/-/1/1/e/0/11e0e518fc48ce00/image_h4az5h.png)

| The `key` (e.g., "name") must match the placeholder name in your PDF template (e.g., `{name}`). The `value` (e.g., "John") is the information that will replace that placeholder.

---
### Related articles you may find helpful

* [How Credit Usage Is Calculated](/en/article/how-credit-usage-is-calculated-5820vc/)
* [How to share templates with other workspaces?](https://support.pdfgeneratorapi.com/en/article/how-to-share-templates-with-other-workspaces-1hq1m2f/)
* [What is Expression Language?](https://support.pdfgeneratorapi.com/en/article/what-is-expression-language-1teiau6/)
