Approval
Pauses the run until a reviewer approves or rejects.
@lainstack/flow/approval · Flow
How to use it
Section titled “How to use it”Use this block to stop the run until a person approves or rejects. Each time it runs it raises a real escalation, and the run stays paused until a reviewer answers or the timeout ends. For an automatic yes or no, use @lainstack/flow/condition. For several checks with a report, use @lainstack/flow/checklist.
- The decision picks the port:
approved,rejectedortimed_out. The block takes exactly one. - The
timed_outport exists only whentimeoutis set. Without a timeout the block waits with no limit. A timeout must be 1 minute to 1 year. reasonis the text the reviewer gave. It can be null.- The request text must be 1 to 2,000 characters and not blank.
- To let the reviewer check data, set the data, its type (
dataSchema) anddataModetogether.documents(up to 32 files) need data. - In
editablemode the reviewer can correct the data before approving. Read the outputvalueafter this block, not the original input, becausevalueholds the corrected data. Corrected data that does not match the type fails the block. - Inside
@lainstack/flow/for-each-item, each item raises its own escalation.
Settings
Section titled “Settings”| Setting | Key | Type | Details |
|---|---|---|---|
| Request (required) | request |
Text | Text shown to the reviewer before they approve or reject. |
| Data to review | data |
Value | Optional typed data the reviewer checks, such as values extracted from a document. |
| Reviewer can | dataMode |
One of Read the data, Correct the data |
Let the reviewer correct the data before approving, or only read it. |
| Source documents | documents |
Value | PDF or image files shown beside the data. |
| Timeout | timeout |
Number | How long to wait before using the Timed out path. Starts as No timeout; when set, choose from 1 minute to 1 year. |
Outputs
Section titled “Outputs”| Output | Path | Type |
|---|---|---|
| Decision | decision |
Text |
| Reason | reason |
Text |
| Exit | Port | Notes |
|---|---|---|
| Approved | approved |
|
| Rejected | rejected |
|
| Timed out | timed_out |
Depends on timeout. |