> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Filesystem: Write all items to a file

> Writes all its input items to a file and returns the path of the created file.

Use this step to gather every item flowing through it and write them all into a single file on a filesystem connection. You choose where the file goes, how the items are formatted in it, and what should happen if a file already exists at that location. After the file is written, the step passes on a single item containing the path of the file it created, so a later step can pick up that path and act on it. Because it gathers all incoming items into one file, anything after this step works with the file path rather than the original items.

This documentation describes: [Schema](/schemas/transformer-step/write-file)

## Fields

**Destination filesystem connection**

Required

The filesystem connection where the file is written, such as a local folder, an SFTP server, or cloud storage.

See the [filesystem](/references/filesystem) reference.

**Formatter**

Required

How the items are turned into the contents of the file, for example as a single CSV, NDJSON, or XML document. The formatter decides the file's structure, including any header and footer wrapped around the items.

See the [list-serializer](/references/list-serializer) reference.

**Destination path to write the file**

Required

The path and filename to write on the chosen connection, for example `exports/products.csv`. You can use [placeholders](/references/placeholders) to build the name from data, such as including a date.

**When the file exists**

Optional

What to do when a file already exists at the destination path. Leave it empty to overwrite the existing file. Choose another option to keep both files, for example by adding a counter to the filename so each run produces a new file.

See the [filesystem-ensure-destination](/references/filesystem-ensure-destination) reference.

## Sample data

This step runs as part of a route, writing to a filesystem connection rather than transforming an item in place, so there is no before/after to show. It collects every item passing through, writes them into one file using the chosen formatter, and then outputs a single item with the path of the file it created, for example `{ "path": "exports/products.csv" }`.

A small example configuration that writes all items as a CSV to a filesystem connection:

```json Configuration theme={null}
{
  "prototype": "write-file",
  "parameters": {
    "filesystem": "my-filesystem-connection",
    "serializer": { "prototype": "csv", "parameters": {} },
    "path": "exports/products.csv"
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.