Flow
Resource
Flowper workspaceFlow is a tenant's automation: triggers and the steps they lead to.
At a glance
| מאפיין | ערך |
|---|---|
| apiVersion | lumen.ai/v1alpha1 |
| kind | Flow |
| Resource name | flows |
| Scope | Namespaced (lives in a workspace's namespace) |
Spec
Fields under spec:. Nested fields are indented under their parent.
| Field | סוג | ברירת מחדל | תיאור |
|---|---|---|---|
budget | object | - | Budget caps what this flow may spend in credits in a calendar month: new runs are held once it is reached. |
budget.monthlyCredits | string | - | MonthlyCredits is the most the runs that started in a calendar month may be charged, in credits. Unset, or no budget at all, is no limit; 0 holds every new run.pattern `^[0-9]+(\.[0-9]{1,3})?$` |
displayNameחובה | string | - | DisplayName is the title the UI shows. metadata.name is a DNS name and cannot carry one. Runs copy it at queue time.minLength 1; maxLength 200 |
locks | list of object | - | Locks are saved files this Flow's runs update, one run at a time: a run takes every lock, and gives them back when it ends, whether it succeeded, failed, was rejected or timed out. A run that finds one taken is held (reason file) until the run holding it ends, oldest first, and then reads the file as that run saved it. The locks are taken by the acknowledge step, which should be the Flow's first: it also tells the sender whether the email starts now or waits. A Flow with locks and no acknowledge step takes them when the run is queued. Declare it on every Flow that saves the same workbook. Test runs take no lock.maxItems 8 |
locks[].fileחובה | string | - | File is the path in Files, under saved/, of the file the Flow reads and updates, such as saved/Prices/master-prices.xlsx: the name the flows share, not one of the numbered copies its saves leave beside it ("master-prices (2).xlsx"). Flows that list the same path wait for each other.minLength 7; maxLength 512; pattern `^saved/[^/]+(/[^/]+)*$`Rule: file must not contain . or .. segments |
nodesחובה | list of object | - | minItems 1; maxItems 64 |
nodes[].approval | object | - | Approval makes this an approval node: the run waits for a person to fill in a form. |
nodes[].approval.attach | boolean | - | Attach emails the files the run holds here with the form, so the person reads the change list and opens the file in one email. Files over the email limit are named in it instead. |
nodes[].approval.fieldsחובה | list of object | - | Fields are what the person fills in.minItems 1; maxItems 20 |
nodes[].approval.fields[].default | string | - | Default prefills the field; placeholders allowed.maxLength 1000 |
nodes[].approval.fields[].label | string | - | Label is what the person reads; defaults to the name.maxLength 200 |
nodes[].approval.fields[].nameחובה | string | - | Name is the output's name, <nodeId>.<name>.maxLength 63; pattern `^[a-zA-Z][a-zA-Z0-9_]*$` |
nodes[].approval.fields[].options | list of string | - | Options a select field offers.minItems 1; maxItems 50 |
nodes[].approval.fields[].required | boolean | - | |
nodes[].approval.fields[].typeחובה | string | - | FormFieldType is what a form field asks for, and the output type it gives: boolean, number and date as such, text and select as string.one of boolean, text, number, date, select |
nodes[].approval.message | string | - | Message is shown above the form; placeholders allowed.maxLength 4000 |
nodes[].approval.onTimeout | object | - | OnTimeout says who is told when the form closes unanswered and the run fails here. |
nodes[].approval.onTimeout.message | string | - | Message replaces the notice's default text; placeholders allowed.maxLength 1000 |
nodes[].approval.onTimeout.notify | list of string | - | Notify are the addresses told: an address or a placeholder such as {email.from}. Empty tells nobody.maxItems 5 |
nodes[].approval.reminders | object | - | Reminders are sent in the form email's thread while nobody has answered. |
nodes[].approval.reminders.after | list of string | - | After is how long after the form's email went out each reminder is sent; one entry is one reminder. Each must be shorter than the node's timeout.maxItems 3 |
nodes[].approval.reminders.message | string | - | Message replaces the reminder's default text; placeholders allowed.maxLength 1000 |
nodes[].approval.subject | string | - | Subject of the email; placeholders allowed.maxLength 200 |
nodes[].approval.timeZone | string | - | TimeZone is the IANA time zone the form's closing time is shown in, instead of the workspace's.maxLength 64 |
nodes[].approval.timeout | string | - | Timeout is how long the form stays open; unanswered by then, the run fails. Defaults to 72h. |
nodes[].approval.toחובה | string | - | To is the address the form is sent to. It may use {<nodeId>.<field>} placeholders, e.g. {email.from}.minLength 3; maxLength 320 |
nodes[].branch | list of object | - | Branch makes this a branch node: an ordered list of cases, like if / else if. The first case whose condition holds runs its next, and the others do not. When none holds, the run takes branchDefault; with none, the run ends quietly on this path.minItems 1; maxItems 8 |
nodes[].branch[].nextחובה | list of string | - | minItems 1; maxItems 8 |
nodes[].branch[].when | object | - | When is the case's condition. It may be left out while the case is not set up yet: the webhook then reports the Flow incomplete, so it can be saved suspended as a draft. When present, its field is strict. |
nodes[].branch[].when.expr | string | - | Expr is the condition as text. Every field in it is a node or trigger upstream on every path to this one, and one of its outputs.maxLength 2000 |
nodes[].branch[].when.field | string | - | Field is <nodeId>.<field>: a node or trigger upstream on every path to this one, and one of its outputs.maxLength 200; pattern `^[a-z0-9]([-a-z0-9]*[a-z0-9])?\..+$` |
nodes[].branch[].when.op | string | - | ConditionOp compares a field to a value. gt, gte, lt and lte need a number or date field; contains needs a string or array field; exists takes no value.one of eq, ne, gt, gte, lt, lte, contains, exists |
nodes[].branch[].when.value | any (free-form) | - | Value is what the field is compared to: a number, string or boolean. A date is an RFC 3339 string. |
nodes[].branchDefault | list of string | - | BranchDefault is the "otherwise" of a branch node: the nodes that run when no case holds. Only a branch node has one, and there is at most one. It is a field of its own, not a case, because a case without a condition is a case not set up yet.minItems 1; maxItems 8 |
nodes[].config | object (free-form) | - | Config is validated against the step's configSchema. Values may use {<nodeId>.<field>} placeholders. Only a step node takes config. |
nodes[].disabled | boolean | - | Disabled switches the node off without deleting it. A run skips it: the documents that reach it go on unchanged and it adds no outputs, costs nothing, and shows in the run as skipped (disabled). A disabled filter lets everything through; a disabled branch sends the run down its first case; a disabled for-each skips its body and goes straight to its end node; a disabled wait or approval does not wait. A reference to its outputs downstream is a warning, and its own settings need not be complete. |
nodes[].filter | object | - | Filter makes this a filter node: when its condition does not hold, the run ends quietly with outcome filtered, not failed. |
nodes[].filter.when | object | - | When may be left out while the filter is not set up yet, as in a branch case; the webhook reports the Flow incomplete. |
nodes[].filter.when.expr | string | - | Expr is the condition as text. Every field in it is a node or trigger upstream on every path to this one, and one of its outputs.maxLength 2000 |
nodes[].filter.when.field | string | - | Field is <nodeId>.<field>: a node or trigger upstream on every path to this one, and one of its outputs.maxLength 200; pattern `^[a-z0-9]([-a-z0-9]*[a-z0-9])?\..+$` |
nodes[].filter.when.op | string | - | ConditionOp compares a field to a value. gt, gte, lt and lte need a number or date field; contains needs a string or array field; exists takes no value.one of eq, ne, gt, gte, lt, lte, contains, exists |
nodes[].filter.when.value | any (free-form) | - | Value is what the field is compared to: a number, string or boolean. A date is an RFC 3339 string. |
nodes[].forEach | object | - | ForEach makes this a for-each node: the nodes after it, up to its end node, run once for each item of a list. |
nodes[].forEach.endחובה | string | - | End is the node that closes the loop and runs once after the last item. It is where the body's last node points.maxLength 63; pattern `^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` |
nodes[].forEach.itemsחובה | string | - | Items is a placeholder naming a list, e.g. {read-sheet.rows}.minLength 3; maxLength 200 |
nodes[].forEach.maxItems | integer | - | MaxItems is the most items the list may have; the default is 100 and the most that can be asked for is 1000.minimum 1; maximum 1000 |
nodes[].idחובה | string | - | maxLength 63; pattern `^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` |
nodes[].next | list of string | - | Next is the nodes that follow. Several run side by side (fan-out); a node with none ends its path. A branch node has none of its own.maxItems 8 |
nodes[].requires | object | - | Requires are labels the node's task needs its worker to carry, on top of what its step's catalog entry and the workspace's task policy require: they add up, and the same label with another value refuses the flow's runs. |
nodes[].requires.matchLabels | map of string | - | |
nodes[].stepRef | object | - | StepRef makes this a step node.Rule: revision is required for kind Step and not allowed for kind ClusterStep |
nodes[].stepRef.kind | string | "ClusterStep" | one of ClusterStep, Step |
nodes[].stepRef.nameחובה | string | - | minLength 1 |
nodes[].stepRef.revision | integer | - | Revision pins a Step to one of its revisions (the Step's status.revision when the flow was pinned). A run uses exactly that revision's configuration, however the Step is edited later.minimum 1 |
nodes[].title | string | - | Title is what the canvas, the run view and errors call this node, in place of its ClusterStep's display title. Display only: conditions and placeholders name a node by its ID, so renaming one never breaks a reference. Titles need not be unique. The webhook trims surrounding whitespace, and runs copy the title at queue time.maxLength 80 |
nodes[].wait | object | - | Wait makes this a wait node: the run pauses, then continues.Rule: set exactly one of for, until |
nodes[].wait.for | string | - | For is how long to wait, e.g. 30m or 48h. |
nodes[].wait.until | string | - | Until is an RFC 3339 time, or a <nodeId>.<field> reference to an upstream date field.minLength 1; maxLength 200 |
onError | object | - | OnError is what happens when a run of this Flow ends failed: the sender of the email that started it gets a short apology in the same thread, and people are told. Unset does nothing, as before.Rule: onError must reply or notify someoneRule: replyBody needs reply: true |
onError.notify | list of string | - | Notify are who is told, by email, with the run's link, the node that failed and its error: each an address, or admins for the workspace's admins.maxItems 10 |
onError.reply | boolean | - | Reply answers the email that started the run, in its thread, through the path reply-to-email uses. A run no email started has nobody to answer and sends no reply. |
onError.replyBody | string | - | ReplyBody is the reply's text, one paragraph per line, in place of Lumen's: "Sorry, we could not process this email. We were alerted and will get back to you.", in English or Hebrew by the email's language. Keep technical detail out of it: the sender reads it.minLength 1; maxLength 1000 |
runLimits | object | - | RunLimits are safety caps on each run's agent steps, enforced while the run goes: a cap reached stops the agent mid-run and fails the step. A Flow whose runs end on a cap several times in a row is suspended (pauseAfter). |
runLimits.maxMinutes | integer | - | MaxMinutes caps the time the run is at work: the time its steps are running, summed over the run. Time spent waiting for a person (an ask-by-email reply, an approval) and time held for a file lock, a budget or an evaluation slot do not count. An agent still working past it is stopped. Unset is no cap.minimum 1; maximum 1440 |
runLimits.maxTokens | integer | - | MaxTokens caps the tokens (input and output, as each run records them) the run's agents may use, all steps together, counting what earlier steps of the run used. Unset is no cap.minimum 1 |
runLimits.pauseAfter | integer | - | PauseAfter is how many runs in a row that end on a cap (this Flow's or an agent's own: turns, cost, tokens, time) suspend the Flow, with the annotation lumen.ai/paused-reason: runaway and a notification to the workspace's admins. Unset is 3; 0 never suspends.minimum 0; maximum 20 |
suspend | boolean | - | Suspend stops new runs. Runs already queued finish. A suspended Flow may be a draft: it is admitted with required step or trigger settings still missing, reports Ready=False (reason ConfigIncomplete), and cannot be unsuspended or run until they are set. |
triggersחובה | list of object | - | minItems 1; maxItems 16 |
triggers[].config | object (free-form) | - | Config is validated against the trigger's configSchema. |
triggers[].connectorRef | object | - | ConnectorRef names the Connector the trigger listens on, required when the trigger requires a connector capability. |
triggers[].connectorRef.nameחובה | string | - | minLength 1 |
triggers[].disabled | boolean | - | Disabled switches the trigger off without deleting it: it starts no runs, whatever arrives, and keeps its settings. A webhook call to it is answered as for a suspended flow (accepted, the trigger skipped). A Flow whose triggers are all disabled is admitted with a warning. |
triggers[].idחובה | string | - | ID is stable across edits; runs record which trigger started them. Conditions and placeholders reference the trigger's outputs as <id>.<field>.maxLength 63; pattern `^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` |
triggers[].nextחובה | list of string | - | Next is this trigger's entry nodes. Several run side by side.minItems 1; maxItems 8 |
triggers[].refחובה | object | - | TriggerReference is a typed reference so namespaced Trigger can be added later. |
triggers[].ref.kind | string | "ClusterTrigger" | one of ClusterTrigger |
triggers[].ref.nameחובה | string | - | minLength 1 |
triggers[].title | string | - | Title is what the canvas calls this trigger, in place of its ClusterTrigger's display title. Display only: references use the ID, so renaming one never breaks a condition or a placeholder. Titles need not be unique. The webhook trims surrounding whitespace.maxLength 80 |
triggers[].when | object | - | When is "Start only when": a condition on this trigger's own outputs (<id>.<field>, the same grammar as a filter's), evaluated where the arrival is taken in, before any run exists. What does not match starts no run and costs nothing; the intake log records it. Only triggers whose intake evaluates it take one (steps.ConditionTriggers). |
triggers[].when.expr | string | - | Expr is the condition as text. Every field in it is a node or trigger upstream on every path to this one, and one of its outputs.maxLength 2000 |
triggers[].when.field | string | - | Field is <nodeId>.<field>: a node or trigger upstream on every path to this one, and one of its outputs.maxLength 200; pattern `^[a-z0-9]([-a-z0-9]*[a-z0-9])?\..+$` |
triggers[].when.op | string | - | ConditionOp compares a field to a value. gt, gte, lt and lte need a number or date field; contains needs a string or array field; exists takes no value.one of eq, ne, gt, gte, lt, lte, contains, exists |
triggers[].when.value | any (free-form) | - | Value is what the field is compared to: a number, string or boolean. A date is an RFC 3339 string. |
Status
Written by Lumen; do not set it. Only the phase and the conditions are described here.
| Field | סוג | ברירת מחדל | תיאור |
|---|---|---|---|
conditions | list of object | - | |
conditions[].lastTransitionTimeחובה | string | - | lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. |
conditions[].messageחובה | string | - | message is a human readable message indicating details about the transition. This may be an empty string.maxLength 32768 |
conditions[].observedGeneration | integer | - | observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.minimum 0 |
conditions[].reasonחובה | string | - | reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.minLength 1; maxLength 1024; pattern `^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$` |
conditions[].statusחובה | string | - | status of the condition, one of True, False, Unknown.one of True, False, Unknown |
conditions[].typeחובה | string | - | type of condition in CamelCase or in foo.example.com/CamelCase.maxLength 316; pattern `^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$` |
Validation rules
The API server (or Lumen's webhook) rejects an object that breaks these.
- every trigger next must name a node
- every node next must name a node
- every branch next must name a node
kubectl columns
| Column | Type | JSONPath |
|---|---|---|
| Owner | string | .metadata.labels.lumen\.ai/owner |
| Version | integer | .metadata.generation |
| Suspended | boolean | .spec.suspend |
| Ready | string | .status.conditions[?(@.type=="Ready")].status |
| Age | date | .metadata.creationTimestamp |
Example
flow.yaml
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: invoice-intake
namespace: tenant-acme
labels:
lumen.ai/owner: git
spec:
displayName: Invoice intake
triggers:
- id: email
ref: {name: email-arrives}
connectorRef: {name: invoices-inbox}
config: {requireAttachment: true}
# "Start only when": tested as the mail arrives, against the
# trigger's own fields. Mail that does not match starts no run and costs
# nothing; the flow's intake log shows it as unmatched. With an allow
# list (above) an unverified sender is refused before this is asked.
when: {expr: 'email.attachments >= 1 AND email.subject !~ "newsletter"'}
next: [text]
# The same flow, started by hand with uploaded documents (runtime API).
- id: manual
ref: {name: manual-run}
next: [text]
nodes:
# Reads the text layer, free. A scan or a photo has none: read-text says
# scanned, and the agent after it reads the file itself.
- id: text
stepRef: {name: read-text}
next: [details]
# AI runs only through the agent step: an extraction is an
# agent with fields, each one an output ({details.supplier}). It reads
# the text read-text read, and the file itself only when there was none
# (files.mode ifNoText). With fields and no tools it runs on the
# platform's cheap model and weighs one credit.
- id: details
stepRef: {name: chat-agent}
config:
instructions: Find these details in the invoice.
fields: [{name: supplier}, {name: date, type: date}, {name: total, hint: Amount due, type: money}]
files: {mode: ifNoText}
next: [rename]
- id: rename
stepRef: {name: rename-file}
config: {pattern: "{supplier} {date}.pdf"}
next: [keep]
- id: keep
stepRef: {name: save-file}
config: {destination: lumen}
הדף עזר לכם?