בקשת אישור
Flow node
approvallogicהשפעה חיצוניתשולח למישהו טופס במייל ומחכה לתשובה שלו. בתשובות אפשר להשתמש בשלבים שאחריו.
במבט אחד
| מאפיין | ערך |
|---|---|
| Node field | approval (set instead of stepRef on a FlowNode) |
| Side effects | yes |
A FlowNode sets exactly one of stepRef, branch, filter, forEach, wait and approval.
הגדרות
The value of the node field, with these settings.
| הגדרה | סוג | ברירת מחדל | תיאור |
|---|---|---|---|
toחובה | string | - | To is the address the form is sent to. It may use {<nodeId>.<field>} placeholders, e.g. {email.from}. |
subject | string | - | Subject of the email; placeholders allowed. |
message | string | - | Message is shown above the form; placeholders allowed. |
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. |
fieldsחובה | list of object | - | Fields are what the person fills in. |
fields[].nameחובה | string | - | Name is the output's name, <nodeId>.<name>. |
fields[].label | string | - | Label is what the person reads; defaults to the name. |
fields[].typeחובה | string | - | |
fields[].required | boolean | - | |
fields[].options | list of string | - | Options a select field offers. |
fields[].default | string | - | Default prefills the field; placeholders allowed. |
timeout | string | - | Timeout is how long the form stays open; unanswered by then, the run fails. Defaults to 72h.pattern `^([0-9]+(\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$` |
timeZone | string | - | TimeZone is the IANA time zone the form's closing time is shown in, instead of the workspace's. |
reminders | object | - | Reminders are sent in the form email's thread while nobody has answered. |
reminders.after | list of string | - | How long after the email went out, such as 24h. Each one sends a reminder if nobody answered by then; at most three, each shorter than the timeout. |
reminders.message | string | - | Empty is Lumen's own text, in the email's language. |
onTimeout | object | - | OnTimeout says who is told when the form closes unanswered and the run fails here. |
onTimeout.notify | list of string | - | Addresses told when nobody answered in time; {email.from} is the sender of the email that started the run. |
onTimeout.message | string | - | Empty is Lumen's own text, in the email's language. |
ה-JSON Schema המלא של ההגדרות: approval.schema.json.
שימוש בתהליך
flow.yaml
apiVersion: lumen.ai/v1alpha1
kind: Connector
metadata:
name: my-email-forward
namespace: tenant-acme
spec:
classRef: {name: email-forward}
config: {}
---
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: approval-example
namespace: tenant-acme
spec:
displayName: "Ask for approval"
triggers:
- id: start
ref: {name: email-arrives}
connectorRef: {name: my-email-forward}
next: [text]
nodes:
- id: text
stepRef: {name: read-text}
next: [approve]
- id: approve
approval:
to: approvals@yourcompany.co.il
subject: "Approve the invoice from {start.from}?"
timeout: 48h
fields:
- {name: approved, label: Approve payment, type: boolean, required: true}
- {name: comment, type: text}
next: [keep]
- id: keep
stepRef: {name: save-file}
config: {destination: lumen}
הדף עזר לכם?