Skip to content

File Operations ​

Performs file and directory operations — including reading, writing, copying, moving, deleting, and listing — on the local file system.

Purpose ​

Use File Operations when a workflow needs to interact directly with files or directories on the server. It covers the full range of common file-management tasks: checking whether a file exists before processing it, reading its contents into the workflow, writing transformed data back to disk, moving completed files to an archive folder, or gathering a list of files matching a pattern for batch processing.

Inputs ​

FieldTypeRequiredDescription
File PathTextYesThe full path to the file or directory to act on.
OperationDropdownYesThe operation to perform. See the Operations table below.
New NameTextNoThe new file name (including extension) for the renamed file. Visible when Operation is Rename.
Destination PathTextNoThe target folder or full file path for copy or move operations. Visible when Operation is Copy or Move.
ContentTextNoThe text to write or append to the file. Visible when Operation is WriteText or AppendText.
BytesTextNoBase64-encoded bytes to write to the file. Visible when Operation is WriteBytes.
OverwriteDropdownNoWhether to replace an existing file at the destination. Visible when Operation is Copy, WriteText, or WriteBytes.
Search PatternTextNoA file-name pattern (e.g. *.txt) used to filter results. Visible when Operation is ListFiles or ListDirectories.
RecursiveDropdownNoWhether to include files or directories in sub-folders. Visible when Operation is ListFiles or ListDirectories.

Visibility Rules ​

New Name is visible when Operation is Rename. Destination Path is visible when Operation is Copy or Move. Content is visible when Operation is WriteText or AppendText. Bytes is visible when Operation is WriteBytes. Overwrite is visible when Operation is Copy, WriteText, or WriteBytes. Search Pattern and Recursive are visible when Operation is ListFiles or ListDirectories.

Operations ​

OperationDescription
RenameRenames the file to the value specified in New Name within the same directory.
CopyCopies the file to Destination Path.
MoveMoves the file to Destination Path.
DeletePermanently deletes the file at File Path.
ExistsReturns true if a file exists at File Path, or false otherwise.
ReadTextReads the entire text content of the file and returns it as a string.
WriteTextWrites Content to the file, creating or overwriting it based on the Overwrite setting.
AppendTextAppends Content to the end of the file.
ReadBytesReads the file and returns its content as a byte array.
WriteBytesWrites the provided byte array to the file.
ListFilesReturns a list of file paths within the directory matching the Search Pattern.
ListDirectoriesReturns a list of sub-directory paths within the directory matching the Search Pattern.
CreateDirectoryCreates the directory specified by File Path and returns its full path.
GetAttributesReturns the file-system attributes of the file as a string.

Outputs ​

NameDescription
ResultThe outcome of the operation. For Rename, Copy, Move, WriteText, WriteBytes, AppendText, and CreateDirectory this is the resulting path. For Delete this is true. For Exists this is a boolean. For ReadText this is the file content as a string. For ReadBytes this is a byte array. For ListFiles and ListDirectories this is a list of paths. For GetAttributes this is a string of attribute flags.

Examples ​

Check whether a file exists before processing
FieldValue
File PathC:\Exports\report.csv
OperationExists
Resulttrue or false
List all PDF files in a folder
FieldValue
File PathC:\Documents\Archive
OperationListFiles
Search Pattern*.pdf
RecursiveFalse
Copy a file to a processing folder
FieldValue
File PathC:\Incoming\data.xml
OperationCopy
Destination PathC:\Processing
OverwriteTrue

Tentech