Skip to content

Fetch and Store Remote File (Files) v1.6.4 Help

Saves the file provided via URL in the Files service.

How can I use this Step?

This Step is useful for saving a publicly available file to Files. After the file is uploaded, you may use it further in the Flow via the Merge field.

How does the Step work?

You provide the file URL, as well as define its status, name and path. When the Step is reached in the Flow, it uploads the file to Files and adds the information about its name, size, extension and URL to the output. To store a file in another OneReach.ai account, use Cross-account settings.

Note: This step is not intended to fetch files stored on FTP/SFTP servers or cloud services like Google Drive, OneDrive, etc.

Note: Uploading a big-sized file may take some time. Make sure to take this into account while constructing the flow.

Prerequisites

To access another OneReach.ai account, make sure you meet the following requirements:

  • Your account has the Super Admin role.
  • Your Flow has the Super Admin flow permission level.
  • You have an Account ID, or User or Flow Authentication token related to the OneReach.ai account you want to access.

File settings

In this section you define the uploaded file, its path, name, status and, optionally, how long it will be stored.

The Files service limits the size of the file path to 1024B, which is equivalent to 1024 Unicode UTF-8 characters. However, Files has to reserve up 124 to characters. Therefore, the length of the defined file path in the Step, including the file name and extension, should not exceed 900 characters.

To set up this section, define the following inputs:

  • File URL or base64 string is the link to the uploaded file set as URL or in the base64 string format.
  • File name should be defined without an extension or left empty to keep the original name.
  • Folder is where the uploaded file will be stored in your Files.
  • File status of the uploaded file that can be later changed in the Files service.
  • Set auto-delete time is optional and allows setting a period after which the uploaded file is deleted.

File URL or base64 string

The URL to the uploaded file must begin with http:\\ or https:\\ and end with the filename and extension.

Note: If the uploaded file contains an image, a preview of the image will show up under the File URL or base64 string field.

Alternatively, the file can be provided in the base64 string format, which is expected, for example, as data:image/jpeg;base64,/....

Folder

To upload the file to an existing folder within Files, click the select folder button, then choose the folder in the popup window.

Alternatively, the folder can be defined in the folder field in the foldername/ format. Use / as the divider. If the defined path doesn't exist, it will be created.

Note: Enter just the / character to upload the file to the root folder.

Note: If a file with the defined name, extension and path already exists, it will be overwritten.

Auto-delete time

By default, the uploaded file will be stored in Files indefinitely. To limit the time to live (TTL) value of the file, turn on the Set auto-delete time toggle, then define the TTL in the Delete file after field. After the Step has been executed, and the set amount of time passes, the file is deleted from Files. TTL limits are between 1min and 365d. Examples of acceptable time formats: 1 week, 115h or 5 min 30 sec.

Warning! The file URL of a file with expired TTL stays active for up to 5 min.

Cross account settings

By default, a user can upload a file only to their own OneReach.ai account. To upload a file from to different OneReach.ai account, please do the following:

  1. Make sure that your OneReach.ai account has the Super Admin role. To check your role, go to the Action desk -> Users. The role is defined under the name of the user. If the role isn't Super Admin, reach out to OneReach.ai support to change it.
  2. Go to the General tab of the Flow, then open Deployment settings -> Flow permissions level and select Super Admin.
  3. Turn on the Use custom authentication token toggle.
  4. Choose one of the access types and provide respective data:
  • For the Authentication token type, select the USER or FLOW type and provide the respective token. Please, reach out to OneReach.ai support to obtain the value for this token.
  • For the Account ID type, provide the Account ID of the user you wish to access. The Account ID value is a unique UUID v4 format string value generated for each OneReach.ai account. An option to Copy account ID can be found in the Profile settings of the OneReach.ai window under the Current account label.
  1. Save and activate the Flow.

Merge field settings

The output data of the Step is stored in a JSON object under the name provided in the Merge field name. To learn more about Merge fields, their types, and how to work with them, follow this link.

Output example

The Step's output includes the following properties:

KeyTypeDescription
urlstringThe link to uploaded the file in Files.
sizenumberThe size of the uploaded file in bytes.
namestringThe File name of the uploaded file.
extensionstringThe file type and extension in type/extension format.
ttlnumberThe auto-delete date of the uploaded file in timestamp format.

See below an example of the merge field object's structure:

json
{
  "url": "https://files.staging.api.onereach.ai/public/6d35064f-e424-42fe-9e97-133e4e3f72db/4b91a186-152g-46eb-dr0d-1a8eb355e8d3/image.jpg",
  "size": 50482,
  "name": "image.jpg",
  "extension": "image/jpeg",
  "ttl": 1681300119268
}
{
  "url": "https://files.staging.api.onereach.ai/public/6d35064f-e424-42fe-9e97-133e4e3f72db/4b91a186-152g-46eb-dr0d-1a8eb355e8d3/image.jpg",
  "size": 50482,
  "name": "image.jpg",
  "extension": "image/jpeg",
  "ttl": 1681300119268
}

Error handling

By default, the Step handles errors using a separate exit. If an error occurs during the Step execution, the Flow proceeds down the error exit, e.g. if the File URL does not lead to a file. For more information on error handling, follow this link.

Reporting

The Step automatically generates Reporting events during its execution, allowing for real-time tracking and analysis of its performance and user interactions. To learn more about Reporting events, follow this link.

Services dependencies

  • bot Deployer v2.22.4
  • library v2.18.4
  • sdk API v2.17.0
  • studio v3.68.0
  • eks Files API v1.3.0

Release notes

v1.6.4

  • Help text was updated

v1.6.2

  • Fixed issue with large files upload
  • Moved MMS - attachments support to the separate step

v1.4.4

  • Fixed the issue with some original names of the files

v1.4.3

  • Added support for MMS - attachments

v1.3.12

  • Added option to set the TTL (time to live) parameter when uploading a file
  • Updated Files SDK

v1.2.44

  • Initial release