Skip to main content

Set fields

Stepset-fieldscontrol

Sets, renames or calculates fields without code. A value can mix text with details found, or be a sum such as the total times 1.17. A date can take a layout, such as {email.receivedAt:MM/yyyy} for 10/2026.

At a glance​

PropertyValue
Step nameset-fields
ResourceClusterStep (lumen.ai/v1alpha1)
Palette group, categorycontrol, logic
Credits0.5 credits each time it succeeds
Side effectsno
Installation must providenothing

Inputs​

PropertyValue
Needsnothing
Producesfields
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​

More outputs are declared in the setting `fields`.

Settings​

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

SettingTypeDefaultDescription
fieldsrequiredlist of object-FieldsminItems 1; maxItems 50
fields[].namerequiredstring-Name is the field, for the steps after this one. A name already there is replaced, so this also renames: set the new name to {old}.minLength 1; maxLength 64; pattern `^[^{}.]+$`
fields[].valuerequiredstring-A date can be written with a layout: {read.date:MM/yyyy} gives 10/2026. Layouts use yyyy, yy, MM and dd, and MMM for the month name in English (Oct).maxLength 500
fields[].typestring-Type is what the value is. Unset, it follows the value: a calculation over number fields is a number, anything else is text.one of string, number, date, boolean

The full JSON Schema of these settings: set-fields.schema.json.

Example​

Add VAT to a price

config
fields:
- name: priceWithVat
type: number
value: '{price} * 1.18'

Use it in a flow​

A node that runs set-fields 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: set-fields-example
namespace: tenant-acme
spec:
displayName: "Set fields"
triggers:
- id: start
ref: {name: manual-run}
next: [set-fields]
nodes:
- id: set-fields
stepRef: {name: set-fields}
config:
fields:
- name: priceWithVat
type: number
value: '{price} * 1.18'