Assign, Track, and Audit Approval Requests

For the complete documentation index, see llms.txt. For a full content snapshot, see llms-full.txt. Append .md to any kestra.io/docs/* URL for plain Markdown.

Available on: Enterprise EditionCloud

Kestra Enterprise adds reviewers, tracking, and notifications to the Approval task.

The Approval task page covers the decision branches, review inputs, automatic approval, expiry, and outputs. This page covers what Enterprise adds on top:

  • assignment restricts who can review a request.
  • Each request opens an approval case, listed on the Approvals page.
  • A later Approval task can add its request to the same case for multi-step sign-offs.
  • In-app notifications reach the assignees and the requester.
  • App blocks let users review a request without opening Kestra.

Request an approval from specific reviewers

The following task asks the platform leads to approve a production deployment within four hours:

id: deploy_to_production
namespace: company.team
inputs:
- id: version
type: STRING
defaults: "2.4.0"
tasks:
- id: approve_deploy
type: io.kestra.plugin.core.flow.Approval
title: "Deploy {{ inputs.version }} to production"
timeout: PT4H
commentRequired: ON_DENY
assignment:
users:
- release-manager@company.com
groups:
- Platform Leads
case:
severity: HIGH
description: "Release notes: https://example.com/releases/{{ inputs.version }}"
onApprove:
- id: deploy
type: io.kestra.plugin.core.log.Log
message: "Deploying {{ inputs.version }}, approved by {{ outputs.approve_deploy.by }}"
PropertyDescription
titleTitle of the request, shown on the Approvals page and in notifications. Defaults to the task ID.
assignmentusers (usernames) and groups (group names) allowed to review. Both accept expressions. At least one user or group is required.
case.enabledWhether to open an approval case for the request. Defaults to true.
case.severitySeverity of the approval case: CRITICAL, HIGH, MEDIUM, or LOW.
case.descriptionMarkdown description of the approval case.
case.slaDeadline of the approval case. Defaults to the task’s timeout.
case.idID of an existing approval case of the same execution to add this request to. See Chain several sign-offs.
inAppNotificationWhether to send in-app notifications when the request has no approval case. Defaults to true.

If assignment names a user that doesn’t exist, the task fails with a User not found error instead of waiting for a review nobody can give.

To review a request, a user needs the REVIEW action on the EXECUTION permission in the flow’s namespace. When the task sets assignment, the user must also be one of the assigned users, or a member of an assigned group. Everyone else gets an access-denied error, from the UI, the API, and Apps alike. See the permissions reference for the endpoints that check REVIEW.

Approval cases

Each approval is a case of kind Approval, listed on the Approvals page and not on Cases.

When the request opens, the approval case gets:

  • The task’s title, and the case.severity and case.description values.
  • The assignment users and groups as assignees.
  • The user who started the execution as a watcher, when a signed-in user started it.
  • A resolution SLA equal to case.sla, or to the task’s timeout.
  • A link to the execution.

The caseId and url outputs of the task point to the approval case, and onWait tasks can already read them.

An approval case follows its request, so its status can’t be changed by hand. The case closes when the request ends:

How the request endsCase statusResolution reason
ApprovedRESOLVEDApproved
DeniedRESOLVEDDenied
ExpiredRESOLVEDExpired
CancelledCANCELLEDCancelled
Execution killedCANCELLEDKilled

The resolution note is the reviewer’s comment. The timeline records an APPROVAL_DECIDED event with the decision, the reviewer, and the comment. When the execution is killed or deleted, the timeline also records who did it, if your license includes audit logs.

Approval cases keep the other case features: comments, watchers, linked assets, custom fields, and CaseEvent triggers. For example, a flow with a CaseEvent trigger on APPROVAL_DECIDED can post every decision to a channel.

Set case.enabled: false to skip the approval case. The request then doesn’t appear on the Approvals page, and the url output links to the execution.

The Approvals page

Approvals in the left menu lists every approval request you can see, with a Resolution column that shows how each request ended. Use the List and Board switch to show the requests as a list or as a board grouped by status: Pending, Resolved, or Cancelled. Switch the scope to Mine to see only the requests assigned to you or to one of your groups.

Click a request’s title to open its approval page, with its details and timeline. Once the request is decided, the page shows the decision, the reviewer, their comment, and the values they entered in the review inputs. The input values are shown only to users who can read the execution.

Click Review, on a list row or a board card, to open the execution with the review dialog. After the decision, Back to Approvals returns to the list. On the execution page, the banner of a paused execution offers Open approval and Review.

To cancel pending requests in bulk, select them and click Cancel request. Each request ends without a decision: no decision branch runs, and its execution ends in CANCELLED. The cancellations run in the background and report their progress in the notifications bell. Requests that can’t be cancelled, for example because they’re already closed or you aren’t allowed to cancel them, are left untouched and listed with the reason.

To delete resolved or cancelled requests, select them and click Delete, or delete a request from its approval page. A pending request can’t be deleted: cancel it first. Delete is unavailable while the selection includes a pending request, and the API refuses a delete call that includes one.

The Approvals page requires the LIST action on the CASE permission, opening a request requires VIEW, and deleting one requires DELETE.

From the API, cancel requests and check which ones you may review by approval case ID, up to 100 IDs per call. The cancel response lists each refused request with the reason in refusals, and returns the operationId of the background operation. Delete closed requests with the cases endpoint:

# Cancel pending requests without a decision
curl -X POST "https://{host}/api/v1/{tenant}/cases/approvals/cancel/by-ids" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '["{caseId1}", "{caseId2}"]'
# Delete resolved or cancelled requests
curl -X POST "https://{host}/api/v1/{tenant}/cases/by-ids/delete" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '["{caseId1}", "{caseId2}"]'
# List the requests the caller may review
curl -X POST "https://{host}/api/v1/{tenant}/cases/approvals/reviewable/by-ids" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '["{caseId1}", "{caseId2}"]'

Chain several sign-offs

A later Approval task in the same execution can add its request to an earlier approval case by passing the earlier task’s caseId as case.id. The requests are reviewed one after the other, and the case keeps the full history in one timeline.

The following flow needs the team lead’s approval, then the CTO’s:

id: purchase_request
namespace: company.team
tasks:
- id: lead_approval
type: io.kestra.plugin.core.flow.Approval
title: Purchase request
assignment:
groups:
- Team Leads
- id: cto_approval
type: io.kestra.plugin.core.flow.Approval
title: Purchase request
assignment:
users:
- cto@company.com
case:
id: "{{ outputs.lead_approval.caseId }}"
- id: order
type: io.kestra.plugin.core.log.Log
message: "Approved by {{ outputs.lead_approval.by }} and {{ outputs.cto_approval.by }}"

When the second request joins the case:

  • The case reopens if the first decision resolved it.
  • The new task’s assignees replace the previous ones, and the previous assignees become watchers.
  • The case deadline restarts from the new request’s timeout or case.sla.

case.id must name an approval case of the same execution that isn’t cancelled.

Notifications

When a request has an approval case, the case notifies its assignees and watchers in the app, like any case.

When a request has no approval case, Kestra sends in-app notifications directly: to each assignee when the request opens, and to the requester when it’s decided. Set inAppNotification: false to turn these off.

The requester is the user who started the execution from the UI, the API, an App, or a case action. An execution started by a schedule, a webhook, or a Flow trigger has no requester. To notify someone outside Kestra, add a notification task to onWait, onApprove, or onDeny.

Review from an App

Apps can show an approval request to reviewers outside the Kestra UI:

  • The ApprovalReview block shows the review inputs, a comment field, and the two decision buttons.
  • The CancelApprovalRequestButton block cancels the request without a decision.
  • The APPROVED, DENIED, and EXPIRED stages show what happened after the decision. APPROVED applies until the execution ends, then SUCCESS or FAILURE takes over.

Set task on a layout to bind it to one Approval task when the flow has several:

layout:
- on: PAUSE
task: approve_deploy
blocks:
- type: io.kestra.plugin.ee.apps.execution.blocks.Inputs
- type: io.kestra.plugin.ee.apps.execution.blocks.ApprovalReview
- type: io.kestra.plugin.ee.apps.execution.blocks.CancelApprovalRequestButton
- on: APPROVED
task: approve_deploy
blocks:
- type: io.kestra.plugin.ee.apps.core.blocks.Markdown
content: "## Deployment approved, deploying {{ inputs.version }} now"
- type: io.kestra.plugin.ee.apps.execution.blocks.Logs
- on: DENIED
task: approve_deploy
blocks:
- type: io.kestra.plugin.ee.apps.core.blocks.Alert
style: ERROR
content: The deployment was denied.

ApprovalReview checks REVIEW and the assignment the same way as the Kestra UI.

Was this page helpful?