# Make Integration: Automate Document Generation


The PDFMonkey module for [Make](https://www.make.com/) lets you generate documents as part of your automated scenarios. Combine it with triggers from form builders, CRMs, or databases to produce and deliver files without writing code.

## Setup {#setup}

Before you begin, make sure you have:

- A PDFMonkey account ([sign up here](https://dashboard.pdfmonkey.io/register))
- A [Make](https://www.make.com/) account
- A published template in PDFMonkey

For account creation and template setup, see [From Zero to First Document](../getting-started/from-zero-to-first-document.md).

To connect PDFMonkey to Make, add the PDFMonkey module to your scenario and click **Create a connection**. Enter your API Secret Key from the [My Account](https://dashboard.pdfmonkey.io/account) page.

## Generate a Document {#generate-a-document}

Add the PDFMonkey **Generate a Document** module to your scenario. Select your Workspace and Template, then map fields from previous modules to the variables defined in your template.

![PDFMonkey field mapping in Make](../img/make-pdfmonkey-field-mapping.webp)

> [!NOTE]
> **Naming variables**
>
> Variable names in your template must follow specific formatting rules. See the [naming variables](../code-templates/defining-dynamic-data.md#naming-your-variables) reference for correct and incorrect formats.


After the module runs, it returns data about the generated document, including the [download URL](../generating-documents/download-url.md) and filename.

![Document generated result in Make](../img/make-document-generated.webp)

## Working with the Generated File {#working-with-the-generated-file}

### Downloading the File {#downloading-the-file}

To use the generated file in downstream modules, download it first. Add the HTTP **Get a File** module and pass it the **Download URL** returned by the PDFMonkey module.

![HTTP Get a File module configuration](../img/make-http-get-file.webp)

> [!TIP]
> The download URL expires after 1 hour. If you plan to use it later, download the file immediately or upload it to permanent storage. See [Download URL](../generating-documents/download-url.md) for details.


### Sending by Email {#sending-by-email}

Add your email provider module (or Make's built-in **Send an email** module) and attach the downloaded file. Customize the **File name** field to avoid the default `file.pdf` name; the PDFMonkey module returns a filename you can use directly.

![Email attachment configuration with custom filename](../img/make-email-attachment.webp)

> [!TIP]
> You can also set a [custom filename](../generating-documents/custom-filename.md) in PDFMonkey so it arrives with a meaningful name in every scenario.


## Example: Tally Form to Document {#example-tally-form}

This example shows a complete scenario that receives a [Tally](https://tally.so/) form submission, generates a document, and sends it by email.

### The Tally Form {#the-tally-form}

The scenario uses a Tally form as its data source:

![Tally form used as scenario trigger](../img/make-tally-form.webp)

### Setting Up the Trigger {#setting-up-the-trigger}

Create a new scenario with Tally's **Watch New Responses** trigger. Make creates a webhook URL and attaches it to your Tally form automatically.

![Tally webhook setup in Make](../img/make-tally-webhook-setup.webp)

Submit a test form entry and click **Run once** to verify the connection:

![Run once button in Make scenario](../img/make-run-once-trigger.webp)

![Trigger data received from Tally](../img/make-trigger-data-received.webp)

### Mapping Fields and Generating {#mapping-fields-and-generating}

With the trigger data available, configure the PDFMonkey module to map Tally fields to your template variables, then add the HTTP and email modules as described in [Working with the Generated File](#working-with-the-generated-file).

> [!WARNING]
> **Always publish your template**
>
> If the documents you generate don't match your template, check that you published it. Forgetting to publish after making changes is a common mistake, especially when switching between Make and PDFMonkey.


## Troubleshooting {#troubleshooting}

### JSON Escaping {#json-escaping}

The Make module sends data as JSON. If your data contains double quotes or line breaks, the JSON becomes invalid. For example, a name like `Peter "Spider-Man" Parker` breaks the JSON structure.

Replace `"` with `\"` inside values to escape double quotes:

![JSON escaping configuration in Make](../img/make-json-escaping.webp)

Line breaks (`\n`) require the same treatment: replace `\n` with `\\n` to keep the JSON valid.

### Template Not Published {#template-not-published}

If the generated documents don't reflect your latest template changes, the most likely cause is an unpublished template. Open your template in PDFMonkey and click **Publish** before running the scenario again.

### Download URL Expired {#download-url-expired}

The [download URL](../generating-documents/download-url.md) is valid for 1 hour. If a later module in your scenario fails because the URL has expired, move the HTTP **Get a File** step closer to the PDFMonkey module so the download happens immediately.

For more details, see [Download URL Returns 403](../troubleshooting/download-url-gives-403.md).

## Next Steps {#next-steps}

- [From Zero to First Document](../getting-started/from-zero-to-first-document.md): Set up your PDFMonkey account and create your first template
- [Defining Dynamic Data](../code-templates/defining-dynamic-data.md): Learn how to structure the JSON payload for your templates
- [Custom Filename](../generating-documents/custom-filename.md): Control the name of generated files
- [Document Statuses](../generating-documents/document-statuses.md): Understand the lifecycle of a generated document
- [Webhooks](../generating-documents/webhooks.md): Receive real-time notifications when documents finish generating
- Explore other integrations: [Zapier](./zapier.md), [n8n](./n8n.md), [Workato](./workato.md)
