# Save the file

> Saves the file to a folder in Files, ready to download, or to one of your connections.

Source: https://docs.go-lumen.ai/de/reference/steps/save-file

## Auf einen Blick

| Eigenschaft | Wert |
| --- | --- |
| **Schrittname** | `save-file` |
| **Ressource** | ClusterStep (`lumen.ai/v1alpha1`) |
| **Palettengruppe, Kategorie** | save, files |
| **Credits** | **1** Credit bei jedem Erfolg |
| **Externe Wirkung** | ja: Er ändert etwas außerhalb von Lumen, deshalb fragt ein Wiederholungsversuch vorher nach, und ein Test zeigt, was er tun würde, statt es zu tun. |
| **Die Installation muss bereitstellen** | nichts |

## Eingaben

| Eigenschaft | Wert |
| --- | --- |
| **Braucht** | `file` |
| **Liefert** | nichts |
| **Arbeitet auf** | item: einem Dokument nach dem anderen |

Braucht und Liefert sind Datentypen (file, text, fields, email). Der Editor bietet einen Schritt nur dort an, wo das, was er braucht, schon auf dem Pfad liegt. Siehe [Dokumente und Daten](https://docs.go-lumen.ai/de/concepts/how-flows-run.md#documents-and-data).

## Ausgaben

Keine benannten Ausgaben. Spätere Knoten sehen weiterhin alles, was auf dem Pfad zuvor entstanden ist, und dieser Schritt reicht die Dokumente unverändert weiter.

## Einstellungen

Wird unter `config:` im Knoten des Flows gesetzt. Texteinstellungen dürfen Platzhalter wie `{nodeId.field}` enthalten.

| Einstellung | Typ | Standardwert | Beschreibung |
| --- | --- | --- | --- |
| `destination` | string | `"lumen"` | Destination is where the files go: lumen (the default) or connector. (one of lumen, connector) |
| `connectorRef` | string |  | ConnectorRef names the Connector a connector destination writes to. (minLength 1) |
| `folder` | string |  | Use / for subfolders, `{flow}` for the flow's name and `{date:yyyy-MM}` for the month. Empty saves to Saved/`{flow}`. A file whose name is taken is saved as name (2). (maxLength 200) |
| `ifExists` | string | `"copy"` | Keep both saves the new file as name (2). Replace saves it under the same name and keeps the previous file in .versions. (one of copy, replace) |
| `connectionFolder` | string |  | Under the connection's folder; empty saves there. A file with the same name is saved as its new version, and SharePoint keeps the old versions. (maxLength 200) |

Das vollständige JSON Schema dieser Einstellungen: [save-file.schema.json](https://docs.go-lumen.ai/schemas/steps/save-file.schema.json).

## Beispiel

```yaml title="config"
destination: lumen
folder: Invoices/{date:yyyy-MM}
```

## Im Flow verwenden

Ein Knoten, der `save-file` ausführt, steht unter `spec.nodes` eines [Flow](https://docs.go-lumen.ai/de/concepts/how-flows-run.md#the-flow-as-yaml). Geben Sie ihm eine beliebige id und nennen Sie in next die ids der nächsten Knoten.

```yaml title="flow.yaml"
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
  name: save-file-example
  namespace: tenant-acme
spec:
  displayName: "Save the file"
  triggers:
    - id: start
      ref: {name: manual-run}
      next: [save-file]
  nodes:
    - id: save-file
      stepRef: {name: save-file}
      config:
        destination: lumen
        folder: Invoices/{date:yyyy-MM}
```
