Skip to content

Create Text File (Files) v1.0.0 Help

Saves the file with defined text in the Files service.

How can I use the Step?

This Step is useful for saving a new text 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 text content of the new file, as well as define the file name, path and status. When the Step is reached in the Flow, it uploads the created file to Files and adds its name, size, extension and URL to the output. To create a file in another OneReach.ai account, use Cross-account settings.

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 created text 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 name can be defined without an extension. However, if entered, it is expected as *.txt, *.json, *.js, *.docx, *.xlsx or any other non-binary file extension.
  • File content supports multiline entries. The size of the file is restricted only by the capacity of your Files service.
  • 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.

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

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.

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 to a 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
downloadUrlstringThe link to uploaded the file in Files.
byteLenghtnumberThe size of the uploaded file in bytes.
filenamestringThe File name of the uploaded file.
typestringThe 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
{
  "downloadUrl": "https://files.staging.api.onereach.ai/public/6t33264f-e424-42bd-9e97-122e4e3f72db/image.jpg",
  "byteLenght": 50482,
  "filename": "image.jpg",
  "type": "image/jpeg",
  "ttl": 1681300119268
}
{
  "downloadUrl": "https://files.staging.api.onereach.ai/public/6t33264f-e424-42bd-9e97-122e4e3f72db/image.jpg",
  "byteLenght": 50482,
  "filename": "image.jpg",
  "type": "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 defined file extension isn't a text extension. 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.7.1
  • library v2.9.0
  • sdk API v2.7.0
  • Studio v2.49.0

Release notes

v.1.1.15

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

v1.0.0

  • Initial release