Write File

Action doc.badge.plus

action.write_file

Write text content to a file on disk. Supports both overwrite and append modes. When overwrite mode is selected, any existing file at the path is replaced. In append mode, content is added to the end of the file. Intermediate directories are created automatically when enabled.

Destructive action

Overwrite mode (the default) replaces the entire file content; the previous content is not recoverable. Use Append mode if you need to add lines without losing existing content. Workflows configured for Overwrite prompt for confirmation on every arm.

Ports

DirectionNameData TypeDescription
InputInputAnyIncoming payload for content interpolation
OutputOutputAnyPayload with write result metadata

Configuration

FieldTypeDefaultDescription
filePathTextDestination file path. Supports {{var}}.
contentText AreaContent to write. Supports {{var}} interpolation.
modeDropdownoverwriteWrite mode: Overwrite or Append
createDirectoriesBooleantrueCreate intermediate directories if they do not exist

Output Variables

VariableTypeDescription
filePathStringAbsolute path to the written file
fileSizeNumberFile size in bytes after writing
writtenBooleanWhether the write succeeded

Example

Save an API response to a file on a schedule: