# Files

> Where the files your flows read and make are kept, how to save them into folders, how long Lumen keeps them, and how email attachments become files.

Source: https://docs.go-lumen.ai/he/data/files

Every document a flow reads or makes is kept in your workspace's Files. A flow can also file its results into named folders, so a person can find them later and another flow can read them again.

-   Files page
-   Save the file
-   365 days

## Where files come from

**Files** in the sidebar lists what Lumen holds for your workspace. Each row says where the file came from, and the filter above the list narrows it to one source.

| Filter | Source label | What it holds |
| --- | --- | --- |
| **From flows** | Made by a run, Given to a run | What a run produced, and the files a run was started with (a file you chose in the **Run** dialog, for example). |
| **From email** | From an email | The attachments of emails that started a run. |
| **Saved by flows** | Saved by a flow | Files that a **Save the file** step put in a named folder. |
| **From Lighthouse** | From Lighthouse | Documents uploaded to a Lighthouse collection. They are deleted in Lighthouse, not here. |

![The Files page. Above the list is a filter with All, From flows, From email, Saved by flows and From Lighthouse, then icon buttons for sort, fields and export. The list has columns Name, Size, Saved and From. Rows include PDF invoices, a JPG scan and two CSV files, each with a size, a relative time and an icon for its source (a run, an email or an upload), and a download and a delete button at the end.](https://docs.go-lumen.ai/he/img/data/files-01-files.png)

*Files, with every source shown. The icon in From says how the file arrived; a flow's name links to its run.*

In the **From** column an icon says how the file arrived (a run, an email, a folder) and, for a file a flow made or saved, the flow's name links to the run. A saved file shows its folder before its name, for example `Invoices/2026-10 / supplier.pdf`.

Open a file with the download button at the end of its row. The download goes through Lumen, so it works the same whether your files are in Lumen's storage or in a store of your own on a self-hosted install.

## Keep a file in a folder

A run's files are kept with the run whether or not you add a step for it. To put a result somewhere a person (or a later flow) can find it by name, add **Save the file** ([`save-file`](https://docs.go-lumen.ai/he/reference/steps/save-file.md)).

| Setting | What it does |
| --- | --- |
| `destination` | `lumen` (the default) saves into Files. `connector` saves to a connection, such as a Microsoft 365 folder, named in `connectorRef`. |
| `folder` | The folder in Files, with placeholders: `{flow}`, any field, and a date as `{date:yyyy-MM}` (the document's date field, else the day the run ran). `/` makes subfolders, up to five levels. Empty saves into `Saved/{flow}`. |
| `ifExists` | What to do when the name is taken. `copy` (the default) saves the new file as `name (2)`, `name (3)` and never touches the old one. `replace` saves it under the same name and moves the previous file into the folder's `.versions` folder. |

A save never overwrites unless you set `ifExists: replace`. A step that runs again after a lost worker finds its own file and saves nothing new. A step that saves files but finds none fails, instead of reporting success over nothing.

`replace` is for a file a flow keeps current, such as a master workbook that other runs read from a fixed path. The previous version goes to `<folder>/.versions/<name> <UTC date and time>.<ext>`. It is an ordinary folder in Files: open an old version and download it to restore it. See [File locks](https://docs.go-lumen.ai/he/data/file-locks.md) for making sure two runs do not replace the same file at once.

The step adds a `saved` field that lists the paths it wrote, and the run page links each one to Files. Name the file first with **Rename the file** ([`rename-file`](https://docs.go-lumen.ai/he/reference/steps/rename-file.md)): `pattern` takes the same placeholders, the file's own extension is always kept, the name is made safe, and a placeholder that finds nothing leaves the file's own name.

```yaml title="files-invoice-filing.yaml"
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
  name: files-invoice-filing
  namespace: tenant-acme
spec:
  displayName: File invoices by month
  triggers:
    - id: email
      ref: {name: email-arrives}
      connectorRef: {name: invoices-inbox}
      config: {attachments: separate, requireAttachment: true}
      next: [name]
  nodes:
    - id: name
      stepRef: {name: rename-file}
      config: {pattern: "{date} {sender}"}
      next: [save]
    - id: save
      stepRef: {name: save-file}
      config:
        destination: lumen
        folder: "Invoices/{date:yyyy-MM}"
        ifExists: copy
```

> **Keep it in Lumen is retired:**
> 
> The older **Keep it in Lumen** step ([`keep-in-lumen`](https://docs.go-lumen.ai/he/reference/steps/keep-in-lumen.md)) does nothing: a run's files are kept in Lumen anyway. It stays valid in flows that already use it, and the editor hides it. Use **Save the file** when you want a named folder.

## Email attachments

Both email triggers (a Lumen forwarding address and a connected mailbox) turn attachments into files of the run. The **Attachments** setting decides how:

| Value | What happens |
| --- | --- |
| `separate` | Each attachment is a document of its own in the same run, carrying the whole email (sender, subject, body). Steps that run per document, such as replying or forwarding, run once per file. |
| `together` | The whole email is one document holding every file. |

Details that surprise people:

-   **At most 20 attachments** per email go into a run. The rest are left out, and each document records how many were skipped.
-   **Images are not files.** Only documents (PDFs, spreadsheets, attached emails and other non-images) are files of a run. Images in the body or attached are kept for AI steps to look at. One exception: an email with no document at all treats its attached images as files, so a photographed receipt still works.
-   The attachments appear in Files under **From email**, and in the run as the files the trigger produced.

## How long files are kept

![The foot of the Files page: the record count, and below it the sentence We keep your files for 365 days. Working files an automation makes while it runs are deleted after 7 days.](https://docs.go-lumen.ai/he/img/data/files-02-retention.png)

*The page states the policy under the list.*

Documents (what a run made, what it was started with, what an email brought, and what you saved) are kept for 365 days on Lumen's hosted service. Working files an automation makes while it runs are deleted after 7 days. Retention is the storage bucket's own lifecycle rule, so on a self-hosted install it is whatever your store is set to; Lumen never changes it. Lumen is not an archive: keep your own copies of anything you must hold longer.

## Delete files

Workspace admins see a delete button on each row, and a checkbox to delete several at once. Members can list and download. Deleting is permanent: there is no trash. Before it deletes, Lumen checks:

-   A file a **run that is still going** needs is kept, and you are told to delete it when the run is done.
-   A file a **flow reads** (for example a price list one of your flows opens from a path) asks you first, because that flow fails until it has another.
-   A **Lighthouse** document is not deleted here. The row links to Lighthouse, where its rules and drafts go with it.

## A file lands in a folder

The trigger **A file lands in a folder** ([`file-added`](https://docs.go-lumen.ai/he/reference/triggers/file-added.md)) appears in the catalog, but nothing fires it yet: there is no folder watcher behind it. Start flows from an email, a form, a webhook, a schedule or by hand with **Run**, which accepts files from your computer.

## Next steps

[SpreadsheetsRead, update and merge the Excel and CSV files you keep.](https://docs.go-lumen.ai/he/data/spreadsheets.md)[File locksMake runs that update the same file take turns.](https://docs.go-lumen.ai/he/data/file-locks.md)[One document or a batchHow a run carries one file or many.](https://docs.go-lumen.ai/he/concepts/one-document-or-a-batch.md)[Email forwardingGive your workspace an address that turns mail into runs.](https://docs.go-lumen.ai/he/connectors/email-forwarding.md)
