Skip to main content

Save the file

Stepsave-filesaveside effects

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

At a glance​

PropertyValue
Step namesave-file
ResourceClusterStep (lumen.ai/v1alpha1)
Palette group, categorysave, files
Credits1 credit each time it succeeds
Side effectsyes It changes something outside Lumen, so a retry asks first and a test shows what it would do instead of doing it.
Installation must providenothing

Inputs​

PropertyValue
Needsfile
Producesnothing
Works onitem one document at a time

Needs and Produces are data types (file, text, fields, email). The editor offers a step only where what it needs is already on the path. See Documents and data.

Outputs​

No named outputs. Later nodes still see everything produced earlier on the path, and this step passes the documents on unchanged.

Settings​

Set under config: on the flow node. Text settings may contain {nodeId.field} placeholders.

SettingTypeDefaultDescription
destinationstring"lumen"Destination is where the files go: lumen (the default) or connector.one of lumen, connector
connectorRefstring-ConnectorRef names the Connector a connector destination writes to.minLength 1
folderstring-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
ifExistsstring"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
connectionFolderstring-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

The full JSON Schema of these settings: save-file.schema.json.

Example​

File two invoices in a monthly folder

config
destination: lumen
folder: Invoices/{date:yyyy-MM}

Use it in a flow​

A node that runs save-file goes under spec.nodes of a Flow. Give it any id, and list the next node ids in next.

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}