- Reviewing and approving high-risk operations
- Validating model outputs before taking action
If you would like to send a notification without pausing the workflow, see notifications.The
notification
input defined here is the same as what is passed to ctx.notify()
.Usage
The following example shows how to use theInterrupt.approval()
function to pause a workflow and wait for human approval.
Approval Notifications
By default, the approval request will be created in the Inferable app. Unless a human explicitly approves or rejects the request, the workflow will be indefinitely paused.Notifications
Approval requests can also provide a notification destination to send the request to.Emails will be delivered from
[email protected]
Slack
If enabled, the Slack integration can also be used to notify users / channels of approval requests.Semantics
Approval Flow
WhenInterrupt.approval()
is returned from a Workflow:
-
The Workflow or Run is
paused
. - The approval request is created.
- An authorized user must approve or reject the request using the API or the App UI.
-
If the approval is successful,
4.1 The workflow will resume execution, and will call the handler again with the same input.
4.2 At this point, since the
context.approved
istrue
, the handler will continue without entering thereturn Interrupt.approval()
block. - If the approval is rejected 5.1 The tool / workflow will be rejected. If this is a tool, the agent will be notified that the tool call was rejected.