Skip to main content
Agent commands. Your AI agent uses these nodes in workflows. You don’t configure them directly.
The file nodes read, write, copy, move, and delete files on disk. They handle both text and binary data with automatic encoding detection. For processing file contents — transforming data, extracting information — pipe the output to a code or LLM node.

read-file

Reads a file and stores its contents in the shared store.

Parameters

Output

Behavior

Text files are returned with 1-indexed line numbers:
Binary files (images, PDFs, executables) are automatically detected and returned as base64-encoded strings. The node detects binary files by:
  • Known extensions: .png, .jpg, .pdf, .zip, .mp3, .exe, .woff, etc.
  • Encoding failures: Files that fail UTF-8 decoding fall back to binary mode
Path handling: Expands ~ to home directory and converts to absolute path.

write-file

Writes content to a file, creating parent directories as needed.

Parameters

Output

Behavior

Atomic writes: Regular writes use a temp file + rename pattern to prevent partial writes. Append mode writes directly. Auto-serialization: Dict and list content is automatically serialized to pretty-printed JSON. Directory creation: Parent directories are created automatically if they don’t exist. Disk space check: Verifies sufficient disk space (2x content size) before writing.

copy-file

Copies a file to a new location, preserving metadata.

Parameters

Output

Behavior

  • Preserves file metadata (timestamps, permissions) using shutil.copy2()
  • Creates parent directories for destination automatically
  • Checks disk space (1.5x file size) before copying
  • Fails if destination exists and overwrite is false

move-file

Moves a file to a new location.

Parameters

Output

Behavior

  • Same filesystem: Uses atomic rename
  • Cross-device: Falls back to copy + delete, preserving metadata
  • Creates parent directories for destination automatically
  • Handles partial success (copy succeeds, delete fails) with warning

delete-file

Deletes a file with required confirmation.

Parameters

Security exception: The confirm_delete parameter must be set in the shared store (via a previous node or template variable). It cannot be provided directly in node parameters. This prevents accidental deletions from workflow configuration files.

Output

Behavior

  • Idempotent: Returns success if file already doesn’t exist
  • Safety: Requires explicit confirmation via shared store
  • Files only: Cannot delete directories (use shell node for rm -r)

Common patterns

Chaining file operations

Working with binary files

Error handling

All file nodes return an error action on failure. Common errors: