# Working with files in Maestro processes

> UiPath Maestro™ supports two ways of handling file attachments at runtime:

UiPath Maestro™ supports two ways of handling file attachments at runtime:

- **Job Attachments** (managed by UiPath® Orchestrator): default and recommended.
- **Data Fabric file fields**: supported alternative.

Both approaches allow you to download, pass, and consume files in a process. The difference lies in how they are governed, and what setup is required.

## Overview: two attachment models

| Use case | Recommended approach |
|-------|---------------------|
| Pass an email attachment to an RPA process | Job Attachment |
| Send a document to an agent for processing | Job Attachment |
| Temporary files used only during execution | Job Attachment |
| Files tied to a long-lived business record | Data Fabric |
| Files reused across multiple processes | Data Fabric |

## Job Attachments (default)

Job Attachments are files managed by UiPath Orchestrator and associated with a process execution (job).

- No Data Fabric enabling and setup required
- Enabled by default
- Governed by Orchestrator retention policies
- Ideal for transient, process-scoped files

This is the recommended way to handle files in Maestro.

### How it works

With Job Attachments, files are handled as process-level attachments:

1. A connector downloads or produces a file.
2. The file is returned as a job attachment reference.
3. That reference is passed to downstream tasks (agents, RPA, connectors).
4. Orchestrator stores and governs the file according to retention policies configured by you.

You do not configure storage explicitly. Maestro and Orchestrator handle it automatically.

### Example: download an email attachment and pass it to another task

#### Step 1: Download the file

1. Add a **Send task**.
2. In **Action**, select **Execute connector activity**.
3. Select the connector (for example, Microsoft Outlook 365 or Box).
4. Choose your connection.
5. Choose the activity that downloads the attachment, **Download File**.
6. Select the desired file.
7. Notice that in the **Output** section, the **File resource** field is autopopulated with **response**. No other configuration necessary.

   **Result:** The file is downloaded and stored as a job attachment. The output reference is available for use in subsequent tasks.

![Job attachment file handling](https://dev-assets.cms.uipath.com/assets/images/maestro/job-attachment-file-handling-8cd16cfb.webp)

#### Step 2: Pass the file to another task

1. Add a **Send task**.
2. Set **Action** to **Execute connector activity**, for example.
3. Select **Microsoft Outlook 365** as **Connector**.
4. Select your connection.
5. Choose the **Send email** activity.
6. Configure the recipient email address, subject and body.
7. In the attachment field, select the reference of the file hosted.

   **Result:** The file is passed by reference to the task. No file content is copied into variables.

![job attachment response](https://dev-assets.cms.uipath.com/assets/images/maestro/job-attachment-response-orchestrator-6205048d.webp)

After debug, you can check the **Variables** tab in **Instance management** to see the output containing the ID that references the attachment ID in UiPath Orchestrator.

![Job attachment Output variable](https://dev-assets.cms.uipath.com/assets/images/maestro/output-variable-job-attachment-5666d07d.webp)

This aligns file lifecycle management with other Orchestrator resources such as jobs and logs.

### Retention and governance

Job Attachments are stored in Orchestrator and follow:

- Orchestrator retention policies
- Tenant or folder-level governance
- Automatic cleanup based on configuration

## Data Fabric attachments (optional)

Data Fabric attachments store files inside Data Fabric entity fields.

- Requires Data Fabric to be enabled and licensed
- Files are persisted as part of a business record
- Suitable when files must be reused, queried, or audited long-term

This model remains fully supported but is no longer required for most scenarios.

### Prerequisites

Before using files in Maestro, make sure that:

* [Data Fabric is enabled](https://docs.uipath.com/data-service/automation-cloud/latest/user-guide/enabling-the-data-service) in your organization or tenant.
* An entity with a file-supporting field is configured.

When a record is created, no additional fields are required beyond those automatically filled by Data Fabric.

### How it works

In the original implementation of file support in Maestro, files were stored in **Data Fabric entities**.

1. A connector downloads a file.
2. You specify:
   - Entity name
   - Record ID
   - File field
3. The stored file is referenced in Data Fabric.
4. Maestro passes a **Data Fabric reference** to downstream tasks.

### Example: download an file from Data Fabric and pass it to another task

#### Step 1: Download the file

1. Add a **Send task**.
2. In **Action**, select **Execute connector activity**.
3. Select the connector (for example, Microsoft Outlook 365 or Box).
4. Select your connection.
5. Choose the activity that downloads the attachment, **Download File**.
6. Select the desired file.
7. In the **Output** section, in the **File resource** field, select the tune menu and choose **Data Fabric**.
8. In the **Data Fabric editor** prompt, fill in the **Entity** and **Field**.

![data fabric editor](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-data-fabric-editor-557066-e4baf84a.webp)

#### Step 2: Pass the file to another task

1. Add a **Send task**.
2. Set **Action** to **Execute connector activity**, for example.
3. Select **Microsoft Outlook 365** as **Connector**.
4. Select your connection.
5. Choose the **Send email** activity.
6. Configure the recipient email address, subject and body.
7. In the **Attachment** field, select **Data Fabric** from the tune menu.

![Attachment in Data Fabric](https://dev-assets.cms.uipath.com/assets/images/maestro/attachment-data-fabric-5eb33e58.webp)

8. In the **Data Fabric editor** prompt, fill in the entity, **Record to fetch** (the RecordId), and the **Field**.

   ![Attachment in Data Fabric](https://dev-assets.cms.uipath.com/assets/images/maestro/maestro-record-id-026edd7f.webp)

After debug, you can check the **Variables** tab in **Instance management** to see the output containing the record ID that references the new file.

   ![Variable output Data Fabric](https://dev-assets.cms.uipath.com/assets/images/maestro/output-variable-data-fabric-ecbfcee1.webp)

The file is passed by reference. No file content is copied into variables. This approach is still valid and fully supported.

### When Data Fabric makes sense

Use Data Fabric when files must:

- Be associated with a business entity
- Be reused across multiple process instances
- Persist independently of process execution
- Participate in data queries or analytics

For more details, see the [Data Fabric user guide](https://docs.uipath.com/data-service/automation-cloud/latest/user-guide/introduction).

## Important behavior notes

- Files are never stored in variables
- Files are passed by reference, not by value
- Job Attachments and Data Fabric references are not interchangeable
- The default behavior favors **Job Attachments**
