> For the complete documentation index, see [llms.txt](https://support.docstudio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.docstudio.com/admin-panel/conversion-rules/how-to-create-a-conversion-rule-outgoing-documents.md).

# How to Create a Conversion Rule (Outgoing Documents)

Create an outgoing conversion rule, test it on a source file, and enable it for matching outgoing documents.

<figure><img src="https://2962383972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqUiFHjwtCCGSaEDqbXb%2Fuploads%2FzAJzaniQODqfEIc60sPB%2Fimage.png?alt=media&amp;token=2db6f45c-c4df-4521-a208-04448a9dfbc1" alt=""><figcaption></figcaption></figure>

### Create an outgoing conversion rule

1. Enter a rule name or keep the default name.
2. Turn on/off the rule.
3. Enable outgoing conversion rule option.
4. Enter a matching rule. Use RegExp to match document names or content to this conversion rule.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Use a pattern to match a set of files. For example, if you have <code>example111.txt</code>, <code>example222.txt</code>, and <code>example333.txt</code>, use <code>example.*.txt</code> to match all of them.</p></div>
5. Select what the system uses for matching:
   * **The name**. Match by file name.
   * **The content**. Match by file content.
6. Enter the template UUID that matches the outgoing document.
7. Select the template version.

   * The system auto-fills the latest template version by default.
   * Select another version from the list if needed.

   When the template UUID and version are filled, the system auto-generates the conversion rule and the template.
8. Upload a source example file from your local machine.
   * The file content appears in the source file preview.
   * To update the content, update the local file and upload it again.
9. Review the generated conversion rule.

   * Click the info icon to see an example.
   * Update the conversion rule if needed.

   Review the auto-generated template.
10. Click the **Run Conversation** <img src="https://2962383972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqUiFHjwtCCGSaEDqbXb%2Fuploads%2FRFBXsAopwJYNag3A5BJo%2Fimage.png?alt=media&amp;token=5b9b1dcd-2630-4520-94b2-3358b82b4bd3" alt="" data-size="line"> button to check the conversion result.
11. Review the result in **Result** window.
12. After successful execution, click the <img src="https://2962383972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoqUiFHjwtCCGSaEDqbXb%2Fuploads%2FWRPVlkwrKhJszTTCM438%2Fimage.png?alt=media&amp;token=f1c550b5-e75d-4913-a281-00b788f07908" alt="" data-size="line"> button to create the conversion rule.

{% hint style="info" %}
Enable the rule and click **Save** to apply it to outgoing documents that match the rule.
{% 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://support.docstudio.com/admin-panel/conversion-rules/how-to-create-a-conversion-rule-outgoing-documents.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
