> For the complete documentation index, see [llms.txt](https://help.docupilot.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.docupilot.app/workflows/workflow-modules-and-mapping.md).

# Workflow Modules and Mapping

Each module performs one action. Select a module on the canvas to configure it.

| Module           | Purpose                                 | Main requirement                               |
| ---------------- | --------------------------------------- | ---------------------------------------------- |
| Form             | Collects data and starts the workflow   | Must be the first module                       |
| Condition        | Routes a run through different branches | Requires connected outcomes                    |
| Template         | Merges workflow data into a template    | Requires a selected template and token mapping |
| Convert          | Converts a generated document to PDF    | Requires one upstream document                 |
| PDF Append       | Combines files into one PDF             | Requires at least two supported inputs         |
| Email Delivery   | Sends files as email attachments        | Requires files and email settings              |
| Webhook Delivery | Posts output to a webhook endpoint      | Requires files and a valid endpoint            |
| eSign Delivery   | Sends PDF documents for signing         | Requires files, signers, and eSign settings    |

## Map Form Fields to Template Tokens

A Template module generates a document from a selected Docupilot template. Map each template token to the workflow value that should populate it.

1. Add and select a **Template** module.
2. Select a published template version.
3. Map the template tokens to fields from the Form module.
4. Review the mappings and save the workflow.

For example:

| Template token         | Form field  |
| ---------------------- | ----------- |
| `{{client_name}}`      | Client Name |
| `{{customer_email}}`   | Email       |
| `{{selected_package}}` | Package     |

If a field is unavailable, update and publish the selected form from Extensions, then return to the Template module.

## Add Conditions and Branches

A Condition module selects a path by evaluating submitted workflow data.

For the sales contract example:

* If **Package** is Standard, generate the standard agreement.
* If **Package** is Premium, generate the premium agreement.
* Use the default outcome when no configured rule matches.

To configure a condition:

1. Add and select a **Condition** module.
2. Add an outcome for each required path.
3. Add rules to every non-default outcome.
4. Connect each outcome to its next module.
5. Keep one default outcome and connect it to the appropriate fallback path.

## Convert Documents

Use a Convert module when a generated document must be a PDF before it can be appended or delivered.

1. Connect the Template module to a **Convert** module.
2. Select the upstream document.
3. Enter the output file name.

## Append Files

Use PDF Append to combine two or more supported PDF or PNG inputs into one PDF.

1. Connect the source modules to a **PDF Append** module.
2. Select the files to include.
3. Arrange the files in the required order.
4. Enter the combined output file name.

If an upstream document has an unsupported format, add a Convert module before PDF Append.

## Add Deliveries

Delivery modules are terminal modules: they send the final files and do not connect to another module.

* **Email Delivery** sends selected files as email attachments.
* **Webhook Delivery** posts workflow output to another system.
* **eSign Delivery** sends PDF documents to configured signers.

You can use form values in supported delivery fields, such as recipients, subjects, messages, or webhook values. Select the files produced earlier on the same path and complete every required delivery setting.

{% hint style="warning" %}
Every published workflow path must end in a delivery module. A delivery cannot use a file produced on an unrelated or later path.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.docupilot.app/workflows/workflow-modules-and-mapping.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
