> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.devit.software/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).

# Generate PDF documents in a workflow

# ${color}[#204a87](Generate PDF documents in a workflow)

${color}[#3465a4](**In this article:**)
* [What the Create PDF document action does](#1-what-the-create-pdf-document-action-does)
* [Create a PDF](#1-create-a-pdf)
* [Where the PDF is saved](#1-where-the-pdf-is-saved)
* [Attach the PDF to an email](#1-attach-the-pdf-to-an-email)
* [Example: send an invoice PDF for every new order](#1-example-send-an-invoice-pdf-for-every-new-order)
* [Limits and tips](#1-limits-and-tips)

With the **Create PDF document** action, a workflow can turn order, product or customer data into a PDF file: an invoice, a packing slip, a gift certificate or a product spec sheet. You can save the file in Shopify or Google Drive and attach it to an email in the same workflow.

# ${color}[#204a87](What the Create PDF document action does)

You design the document in a text editor and insert variables, such as `{{order.name}}` or `{{product.title}}`. Each time the workflow runs, React Flow fills in the real values and creates a PDF file. You'll find the action under **Action** > **External** > **Create PDF document**.

# ${color}[#204a87](Create a PDF)

1. In a workflow, click **+**, select **Action** and choose **Create PDF document**.
2. In **File name**, enter the name of the file. You can use variables, for example `invoice-{{order.name}}`.
3. In **File content**, write the document. Use the editor toolbar for headings, tables and formatting, or click **<>** to edit the HTML directly. Click **Add variables** to insert store data, and **Preview** to check the result.
4. Under **Select storage**, choose where to save the file (see below).
5. Click **Save**.

![](https://storage.crisp.chat/users/helpdesk/website/-/3/2/7/1/3271b421d88bd400/create-pdf-document-settings_2emidi.png =800x382)


If a file with the same name already exists in the storage, the name is changed automatically so that each file stays unique.

# ${color}[#204a87](Where the PDF is saved)

* **Shopify**: the file is saved in your Shopify Files (**Content** > **Files**). The content can be up to 20 MB.
* **Google Drive**: the file is saved in Google Drive. Select your Google connection under **Select connector**. The content can be up to 25 MB. See [Google Drive connector: save workflow files to Google Drive](https://help.devit.software/en/article/google-drive-connector-save-workflow-files-to-google-drive-lmp3xk/).
* **No storage**: "Files won't be saved remotely, but can still be used in this workflow." Choose this if you only need to send the PDF in an email.

After the action runs, the run details show the file name, storage type and **Created document URL**.

# ${color}[#204a87](Attach the PDF to an email)

1. Add a **Send email** action after **Create PDF document**.
2. Fill in the email fields as usual.
3. Select the **Attachments** checkbox and click **Add files**.

![](https://storage.crisp.chat/users/helpdesk/website/-/3/2/7/1/3271b421d88bd400/send-email-attachment_1k5jtnj.png =800x382)


4. In the **Select file** window, open the **Workflow** tab. It lists the files that earlier steps of this workflow create. Select your PDF and click **Done**.

![](https://storage.crisp.chat/users/helpdesk/website/-/3/2/7/1/3271b421d88bd400/select-file-workflow-tab_19fu7tn.png =620x659)


The **Shopify** and **Google Drive** tabs let you attach files that already exist in your storage, for example your terms and conditions.

# ${color}[#204a87](Example: send an invoice PDF for every new order)

1. Trigger: **Order created**.
2. Action: **Create PDF document**.
   * File name: `invoice-{{order.name}}`
   * File content: your invoice layout with variables such as `{{order.name}}`, `{{order.totalPriceSet.shopMoney.amount}}` and `{{order.currencyCode}}`. To list the products, use a Liquid loop:
`{% for line_item in order.lineItems %}{{line_item.name}} × {{line_item.quantity}}<br>{% endfor %}`
* Select storage: **Shopify**
3. Action: **Send email** to `{{order.email}}`, with the PDF attached from the **Workflow** tab.
4. Click **Run Test** > **Execute** to try it on a real order, then **Turn on** the workflow.

# ${color}[#204a87](Limits and tips)

* Keep the content under 20 MB for Shopify storage or 25 MB for Google Drive. Large images increase the size quickly, so use compressed images.
* Use **Preview** in **File content** to check the layout before you save.
* Use **Run Test** > **Simulate** to check the logic without creating files or sending emails. Use **Execute** to create a real PDF.
* The default React Flow email has a limit of 500 emails per day. For reliable delivery and no daily limit, connect your own SMTP or Microsoft account.

# ✔️ Next step

Check our articles to learn more about the app's functionality:

* [Google Drive connector: save workflow files to Google Drive](https://help.devit.software/en/article/google-drive-connector-save-workflow-files-to-google-drive-lmp3xk/)
* [Generate images with OpenAI in a workflow](https://help.devit.software/en/article/generate-images-with-openai-in-a-workflow-9b5nmk/)
* [Send email with SMTP connector](https://help.devit.software/en/article/send-email-with-smtp-connector-1a8c0il/)
* [Workflow testing](https://help.devit.software/en/article/workflow-testing-1m51cf9/)