File Ops
Perform file system operations on the machine where the Tensorify CLI runner is running — read, write, append, find-and-replace, list, copy, move, and delete files and directories.
Runs on the CLI runner only — requires tensorify runner start on your machine. Managed cloud execution cannot access your local filesystem. No authentication is required; paths are resolved against the runner host's file system.
Each node run executes a single operation. Set Operation in the node settings, then configure the fields shown for that operation.
Read the full text content of a file at the given path. Returns UTF-8 decoded content.
Config:
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| operation | enum | Yes | read |
| path | string | Yes | Absolute or relative path to the file. Supports {{ }} bindings. |
Output:
{
"success": true,
"content": "file contents here",
"files": [],
"replacements_made": 0,
"error": ""
}
Create or overwrite a file. Parent directories are created automatically if they do not exist.
Config:
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| operation | enum | Yes | write |
| path | string | Yes | Target file path. Supports bindings. |
| content | string | Yes | Text to write to the file. Supports bindings. |
Output:
{
"success": true,
"content": "",
"files": [],
"replacements_made": 0,
"error": ""
}
Append text to an existing file, or create the file (and parent directories) if it does not exist.
Config:
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| operation | enum | Yes | append |
| path | string | Yes | Target file path. Supports bindings. |
| content | string | Yes | Text to append. Supports bindings. |
Output:
{
"success": true,
"content": "",
"files": [],
"replacements_made": 0,
"error": ""
}
Replace all occurrences of a search string in a file. Returns the updated content and a count of replacements made.
Config:
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| operation | enum | Yes | replace |
| path | string | Yes | Target file path. Supports bindings. |
| find | string | Yes | Text to search for. Supports bindings. |
| replace_with | string | Yes | Replacement text. Supports bindings. |
Output:
{
"success": true,
"content": "updated file contents",
"files": [],
"replacements_made": 3,
"error": ""
}
List files in a directory matching a glob pattern. Returns absolute paths sorted alphabetically.
Config:
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| operation | enum | Yes | list |
| path | string | Yes | Directory path to list. Must be a directory. |
| pattern | string | No | Glob pattern (default *). Example: *.txt, **/*.json. |
Output:
{
"success": true,
"content": "",
"files": ["/home/user/logs/app.log", "/home/user/logs/error.log"],
"replacements_made": 0,
"error": ""
}
Copy a file to a destination path using shutil.copy2, preserving metadata. Parent directories at the destination are created automatically.
Config:
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| operation | enum | Yes | copy |
| path | string | Yes | Source file path. |
| destination | string | Yes | Destination file path. Supports bindings. |
Output:
{
"success": true,
"content": "",
"files": [],
"replacements_made": 0,
"error": ""
}
Move or rename a file or directory. Parent directories at the destination are created automatically.
Config:
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| operation | enum | Yes | move |
| path | string | Yes | Source path. |
| destination | string | Yes | Destination path. Supports bindings. |
Output:
{
"success": true,
"content": "",
"files": [],
"replacements_made": 0,
"error": ""
}
Delete a file, symlink, or directory. Directories are removed recursively.
Config:
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| operation | enum | Yes | delete |
| path | string | Yes | Path to delete. |
Output:
{
"success": true,
"content": "",
"files": [],
"replacements_made": 0,
"error": ""
}
All operations emit the same result object on the result handle, accessible downstream as {{ file_ops.* }}:
| Field | Type | Description |
|-------|------|-------------|
| success | boolean | Whether the operation completed without error |
| content | string | File content (read, replace) or empty string |
| files | array | Matched file paths (list) or empty array |
| replacements_made | number | Count of replacements (replace) or 0 |
| error | string | Error message on failure, otherwise empty |
On failure, the node routes through the On Error control output with an error message.
Connect a File Ops node to an AI Agent Tools handle to give the agent local file system access.
Use Allowed Operations (Agent) to restrict which operations the agent can invoke — for example, allow only read and list for read-only access. Operations not in the allowed list are rejected at runtime. This setting is excluded from the tool schema the agent sees; the agent selects from the permitted operations only.
When used as a tool, the agent supplies operation, path, and any operation-specific fields (content, find, replace_with, destination, pattern) as tool arguments.
A webhook workflow that appends each incoming payload to a local log file:
- Add a File Ops node after your trigger.
- Set Operation to
append. - Set Path to
/var/log/tensorify/events.log. - Set Content to
{{ webhook.body }}\n. - Deploy with CLI execution mode and run
tensorify runner start.
Downstream nodes can reference {{ file_ops.success }} to branch on whether the write succeeded.
