# 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

Direction | Name | Data Type | Description
--- | --- | --- | ---
Input | Input | Any | Incoming payload for content interpolation
Output | Output | Any | Payload with write result metadata

## Configuration

Field | Type | Default | Description
--- | --- | --- | ---
filePath | Text | — | Destination file path. Supports `{{var}}`.
content | Text Area | — | Content to write. Supports `{{var}}` interpolation.
mode | Dropdown | `overwrite` | Write mode: Overwrite or Append
createDirectories | Boolean | `true` | Create intermediate directories if they do not exist

## Output Variables

Variable | Type | Description
--- | --- | ---
filePath | String | Absolute path to the written file
fileSize | Number | File size in bytes after writing
written | Boolean | Whether the write succeeded

## Example

Save an API response to a file on a schedule: