Skip to main content

Rename the file

Steprename-filefiles

Names the file from the details found, for example the supplier and the date. The file keeps its own extension.

At a glance​

PropertyValue
Step namerename-file
ResourceClusterStep (lumen.ai/v1alpha1)
Palette group, categoryfiles, files
Credits1 credit each time it succeeds
Side effectsno
Installation must providenothing

Inputs​

PropertyValue
Needsfile
Producesfile
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
patternstring-Pattern names the file from fields: "{supplier} {date}", or "{find-invoice-details.reply}" for a step's answer. The original file's extension is always kept: added when the name has none, never doubled.minLength 1

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

Example​

Name an invoice after its supplier and date

config
pattern: '{supplier} {date}'

Use it in a flow​

A node that runs rename-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: rename-file-example
namespace: tenant-acme
spec:
displayName: "Rename the file"
triggers:
- id: start
ref: {name: manual-run}
next: [rename-file]
nodes:
- id: rename-file
stepRef: {name: rename-file}
config:
pattern: '{supplier} {date}'