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.
Use File Ops when you need to:
- Read or write local files from a CLI-deployed workflow
- Append log entries or event data to a file on the runner host
- List, copy, move, or delete files as part of an automation
- Give an AI Agent controlled local file system access via the Tools handle
Best with the CLI runner (tensorify runner start) — paths resolve against your machine's real filesystem. In managed mode, File Ops runs inside a sandboxed environment with an ephemeral filesystem: your local files are not accessible, and writes are discarded after execution. Use CLI execution mode for real file operations.
| Handle | Type | Description |
|---|---|---|
input | any | Upstream data for {{ input.field }} template references in settings fields. |
| Handle | Type | Description |
|---|---|---|
result | object | File operation result |
The result (accessed as {{ file_ops.* }}) shape:
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the operation completed without error |
content | string | File content (for read and replace) or empty string |
files | array | Matched file paths (for list) or empty array |
replacements_made | number | Count of replacements (for replace) or 0 |
error | string | Error message on failure, otherwise empty |
{
"success": true,
"content": "file contents here",
"files": [],
"replacements_made": 0,
"error": ""
}
| Setting | Type | Default | Description |
|---|---|---|---|
operation | enum | read | Operation to run: read, write, append, replace, list, copy, move, or delete. |
allowed_operations | multi-select | all operations | Which operations are available when this node is connected to an AI Agent Tools handle. Excluded from the agent tool schema. |
| Setting | Type | Default | Description |
|---|---|---|---|
path | string | — | File or directory path. Supports {{ }} bindings. Required. |
| Setting | Type | Default | Description |
|---|---|---|---|
content | code editor (text) | — | Content to write or append to the file. Supports {{ }} bindings. |
| Setting | Type | Default | Description |
|---|---|---|---|
find | string | — | Text to search for in the file. Supports {{ }} bindings. |
replace_with | string | — | Replacement text. Supports {{ }} bindings. |
| Setting | Type | Default | Description |
|---|---|---|---|
destination | string | — | Destination path for copy or move operations. Supports {{ }} bindings. |
| Setting | Type | Default | Description |
|---|---|---|---|
pattern | string | * | Glob pattern for listing files. Supports template expression bindings. |
Append each webhook 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.
Read a config file and pass content downstream:
- Operation:
read - Path:
/etc/myapp/config.json
Access the file content:
{{ file_ops.content }}
{{ file_ops.success }}
import webhook from @tensorify/webhook-trigger:4.0.0
import files from @tensorify/file-ops:1.0.0
node trigger @tensorify/webhook-trigger:4.0.0 {
path = "/events"
method = "POST"
}
node log @tensorify/file-ops:1.0.0 {
operation = "append"
path = "/var/log/tensorify/events.log"
content = "{{ webhook.body }}\n"
}
trigger.payload -> log.input
File Ops has an On Error control output branch. Enable it via the "Error output handle" toggle at the bottom of the settings panel.
The error branch fires when:
- The target file or directory does not exist (for read, replace, etc.)
- Permission is denied for the path
- A copy or move destination already exists and cannot be overwritten
- An operation is rejected because it is not in Allowed Operations (Agent) when used as an agent tool
Connect the error branch to a fallback notification or logging action. You can also check {{ file_ops.success }} and {{ file_ops.error }} on the main output path.
- Managed mode is sandboxed: File Ops runs in managed mode but inside an ephemeral sandbox — no access to your local files, and all writes are discarded after execution. Deploy with CLI mode for real file operations.
- Write creates parent directories:
writeandappendcreate parent directories automatically if they do not exist. - Delete is recursive: The
deleteoperation removes directories recursively — use with caution. - List requires a directory: The
listoperation expectspathto be a directory, not a file. - Agent permissions: Restrict Allowed Operations (Agent) to
readandlistonly for read-only agent access.
- AI Agent — connect File Ops as a file system tool for agents
- Shell — run shell commands on the runner host
- Webhook Trigger — trigger file writes from incoming events
- Deploying Workflows — configure CLI execution mode
