Skip to content

Approval

Pauses the run until a reviewer approves or rejects.

@lainstack/flow/approval · Flow

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, rejected or timed_out. The block takes exactly one.
  • The timed_out port exists only when timeout is set. Without a timeout the block waits with no limit. A timeout must be 1 minute to 1 year.
  • reason is 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) and dataMode together. documents (up to 32 files) need data.
  • In editable mode the reviewer can correct the data before approving. Read the output value after this block, not the original input, because value holds 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.
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.
Output Path Type
Decision decision Text
Reason reason Text
Exit Port Notes
Approved approved
Rejected rejected
Timed out timed_out Depends on timeout.