Set File

The Set File block uploads or defines a file as an input so it can be used by downstream blocks in an automation flow (for example, attaching a PDF to an email or passing a file to another block for processing). Available from 2025.1 onward.

When fully expanded, the following is an example of the Set File block with sample data:

image-20260203-161328.png

Note: The screenshot on this page uses the Elegance Design, introduced in 2025.3. If you are using an earlier version, your layout may look different.

Quick-start

  1. Drag Set File onto the canvas.

  2. Connect the block in the flow and specify Source type and the corresponding file input (for example select a file when using Data file or Local path).

  3. Run the flow when it’s ready.

Building block parameters

Parameters
  • Block header: The green input connector triggers the block to start executing. The green output connector triggers when the file has been successfully set and is ready for downstream use. You can rename the block by double-clicking the header text and typing a new title.

  • File Input: Defines the file that will be made available to the flow. The block supports common formats such as .txt, .csv, .json, .pdf, .xlsx, and .xml, and the file content is stored in the Leapwork database for use during execution.

  • Source type: Selects how the file is provided to the block.

    • Data file: Selects a file that already exists in Leapwork’s Data Files library.

    • Local path: Lets you select and upload a file from the local machine.

  • Text fields: Stores key–value pairs that can contain dynamic content and be inserted into supported fields via Insert token.

  • File: Outputs the file produced by the block so it can be used as input in other building blocks in the flow.

  • Failed: Triggers if the block fails to upload or retrieve the file, such as when file input is missing, the file format is unsupported, or an internal system error occurs.

Resources

Topic

Description

Flows FAQ

Common questions about creating, running, and managing flows in Leapwork.

Flows Troubleshooting

Guidelines and solutions for identifying and fixing issues that occur when building or running flows in Leapwork.