Flow inputs

更新时间:
复制 MD 格式

The inputs and outputs of an automated flow define how the flow integrates with your system. This topic describes how to design inputs for different scenarios.

Recommendations for designing flow inputs

The primary inputs for the design flow include the following:

  • Determine the trigger method for the automated flow: manual execution in the client, scheduled execution, OpenAPI trigger, or MCP trigger.

  • Determine the type of information to use as input for the flow. This includes:

    • Strings, numbers, and time values, such as a start time and an end time.

    • Batch data, such as multiple order numbers for refunds. The data can be in a file, such as an Excel file, or a structured string, such as a JSON string.

    • Binary files, such as images and videos.

Manual execution on a client

Information type

Recommended method

Strings, numbers, etc.

  • Select the corresponding type in the parameter panel to simplify manual execution.

Batch data

  • If users need to prepare data manually, use an Excel file. Set the parameter type in the parameter panel to "Open File" or "Open Folder".

  • If you can get the data from another system through an API, call the API in the flow.

Images and videos

  • If the file is on the hard drive of the robot's host computer, set the parameter type in the parameter panel to "Open File" or "Open Folder".

  • If the images or videos can be downloaded automatically, pass the download URLs as strings. If there are multiple URLs, consider using an Excel file.

Scheduled execution

Information type

Recommended method

Strings, numbers, etc.

  • Set the parameter type in the parameter panel to "Text Box".

Batch data

  • If the data volume is small, use a "Text Box" parameter. When you configure the scheduled task, add the data to the task parameters.

  • Otherwise, if you can get the data from another system through an API, call the API in the flow. If not, you must prepare the data on the hard drive of the robot's host computer in advance for the robot to read at runtime.

Images and videos

  • Design the flow to download the images or videos.

  • Otherwise, you must prepare the data on the hard drive of the robot's host computer in advance for the robot to read at runtime.

OpenAPI and MCP triggers

Information type

Recommended method

Strings, numbers, etc.

  • Set the parameter type in the parameter panel to "Text Box".

Batch data

  • If the data volume is small, use a "Text Box" parameter and enter the content as a JSON formatted string.

  • Otherwise, provide the automated flow with a remote access URL. The flow can then download the data and perform subsequent actions.

Images and videos

  • Design the flow to download the images or videos. The input parameter should be the download link. For multiple links, use a JSON string, or save the files to the cloud and pass the endpoint.

  • To pass a single, small image file, read the binary content of the image, apply Base64 encoding, and then pass it as an input parameter.

Creating flow input parameters using the parameter panel

In both code-based and visual development modes, a parameter panel is available at the bottom of the client. You can use this panel to create flow input parameters.

image

  • The parameter panel supports types such as Text Box, Password Box, Drop-down List, Check Box, Open Folder, Open File, Time (Time Range picker), Color (Color picker), and Text Editor.

  • Remote trigger methods, such as scheduled tasks, OpenAPI triggers, and MCP triggers, support only Text Box parameters.

  • For manual execution, you can select the appropriate parameter type.

  • After parameters are passed into a flow, their data type is always a string. You must perform any necessary format conversions within the flow.

In code-based development mode

In the flow code, use rpa.project.params["Parameter Name"] to read the value of an input parameter. For more information, see Param.

The following figure shows an example of how to read the content of a parameter and convert its type. In this example, two Text Box parameters are defined: p1_str and p2_number.

In visual development mode

In a visual flow, you can use the Get Project Parameter Panel Information node to read the input parameters of the flow.

The following figure shows an example of how to read the content of a parameter and convert its type. In this example, two Text Box parameters are defined, p1_str and p2_number. The Convert String to Number node is used for the type conversion.

More examples

Input parameter is a JSON string

  • Code-based development mode. Use the json.loads method to convert the JSON string to a dict type.

    image

  • Visual development mode. Use a custom script to convert the JSON string to a dictionary (dict) type.

    image

    image

Using Alibaba Cloud OSS to transfer data

When you use OpenAPI or MCP to invoke a flow, you can upload the data to a cloud storage service, such as Alibaba Cloud Object Storage Service (OSS), and then pass the endpoint to the automated flow for processing.

In this scenario, you can use the signed URL feature of Alibaba Cloud OSS. For more information, see Use a signed URL.