Skip to content

Create Text File

This Step helps save a new text file to Files. After uploading the file, you can use it further in the Flow via the Merge field.

How does the Step work?

You provide the text content of the new file and define the file name, path, and status. When the Flow reaches this Step, 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/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 the system will store it.

The Files service limits the size of the file path to 1024B, equivalent to 1024 Unicode UTF-8 characters. However, Files has to reserve up to 124 characters. Therefore, the defined file path length 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 file size 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 you can later change
  • Auto-delete time is optional and allows setting a period after which the uploaded file is deleted.

TIP

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 Select folder, 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.

TIP

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 file's time to live (TTL) value, 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 1 minute and 365 days. Here are examples of acceptable time formats: 1 week, 115h, or 5 min 30 sec.

WARNING

The file URL with auto-delete stays active for up to 5 min.

Cross-account settings

By default, you can upload a file only to your OneReach.ai account. To upload a file to a different OneReach.ai account, do the following:

  1. Make sure that your OneReach.ai account has the Super Admin role. To check your role, go to Action desk -> Users. The role is defined under the user name. If your role isn't Super Admin, contact 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. 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. You can find the option to Copy the account ID in the Profile settings of the OneReach.ai window under the Current account label.
  1. Save and activate the Flow.

Merge field settings

The Step returns the result as a JSON object and stores it in the Merge field. 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 the uploaded file in Files.
byteLengthNumberThe 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.
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.