File v2

The File Node reads, writes, copies, moves, deletes, inspects, lists, and listens for files and folders on the local file system of a Local Runtime.

Revision History

0.0.0.1 - Initial release.
0.0.0.3 - Project restructure.
0.0.0.5 - SupportedCluster update.
0.0.0.10 - Node name correction.
0.0.0.20 - Added Listen method.
0.0.0.22 - Corrected Listener rename tracking so reused file names are detected.
0.0.0.23 - Updated the Node icon.
0.1.0.1 - Added configurable file locking to the Read method.
0.1.1.0 - Added List method.
0.1.1.1 - Fixed template methods.

Setup Notes

This Node runs against the local file system of the Local Runtime where the Workflow executes.

Make sure the Local Runtime service account has the required access to the paths that the Workflow will read, write, move, delete, or watch.

Methods

The File Node exposes local file operations, filtered directory listings, and a listener trigger for file and folder changes.

Read

Reads a local file and returns its content as a stream. You can choose whether the Node permits compatible access from other processes while the stream is being consumed.

Parameter Type Description
Path String Path of the file to read.
LockType FileLockType Controls access while the file is being read. Non-Exclusive permits compatible readers, writers, and file replacement. Exclusive prevents other processes from opening the file. The default is Non-Exclusive.
Return Type Description
Content Stream Stream containing the file content.

Write

Writes content to a local file and can replace an existing file when requested.

Parameter Type Description
Path String Path of the file to write.
Content Stream Content stream to write to the file.
OverwriteExisting Boolean When true, an existing file is replaced.
Return Type Description
None None This method does not emit output values.

Copy

Copies a local file to another location on the same file system and can replace an existing destination file.

Parameter Type Description
Path String Path of the file to copy.
Destination String Destination folder where the file should be copied.
OverwriteExisting Boolean When true, an existing file at the destination is replaced.
Return Type Description
None None This method does not emit output values.

Move

Moves a local file to another location on the same file system and can replace an existing destination file.

Parameter Type Description
Path String Path of the file to move.
Destination String Destination folder where the file should be moved.
OverwriteExisting Boolean When true, an existing file at the destination is replaced.
Return Type Description
None None This method does not emit output values.

Delete

Deletes a local file.

Parameter Type Description
Path String Path of the file to delete.
Return Type Description
None None This method does not emit output values.

Info

Retrieves metadata for a local file or folder.

Parameter Type Description
Path String Path of the file or folder to inspect.
Return Type Description
Metadata Object Metadata object containing ObjectType, ObjectPermission, SizeInBytes, CreationTime, LastWriteTime, and FullPath.

List

Lists files in a local directory using a wildcard filter and bounded subdirectory traversal.

Parameter Type Description
DirectoryPath String Path of the directory containing the files to list.
Filter String Wildcard expression matched against file names. The default is *.
FolderDepthLimit Integer Maximum number of subdirectory levels to traverse, from 0 to 50. Set 0 to list only the supplied directory.
ReturnFullPath Boolean When true, each item contains the full path. When false, each item contains only the file name. The default is true.
Return Type Description
Files Array Matching files sorted by path. Each item includes FilePath, the one-based CurrentRow, and TotalRows.

The Node captures the complete listing before returning the output stream, so path, permission, and provider failures surface before downstream enumeration begins. No matches return zero rows. Only files are returned; duplicate full paths are removed before row numbers are assigned. Later file changes are not reflected in the snapshot.

Listen

Watches a local file or folder and fires when a matching file is created, modified, or renamed.

Parameter Type Description
Path String Folder or file path to watch for changes.
Mask String File mask used when watching a folder, such as *.txt or *.*.
PollInterval Integer Time in seconds between checks when polling is used. Set 0 to use event-based monitoring.
FolderDepthLimit Integer Subdirectory depth to evaluate. 0 means only the supplied directory level is watched.
FindMatchesOnStart Boolean When true, matching files are emitted immediately when the Node starts.
Return Type Description
Files Array Array of file-change events. Each item includes ChangedFilePath.

Usage Notes

Use exact local paths that are valid on the machine running the Local Runtime.

When OverwriteExisting is true, Write creates a missing parent folder. The Copy and Move methods also create a missing Destination folder.

The Read method releases its file handle when the content reaches the end of the stream or the stream is disposed. A Non-Exclusive read cannot override an exclusive lock held by another process.

The List method captures a snapshot before it returns the matching files. Use Filter and FolderDepthLimit to limit the listing.

For folder listeners, use Mask and FolderDepthLimit to keep the watch scope predictable and to avoid reacting to unrelated files.