Pause
Pause the current execution and wait for approval (either by humans or other automated processes).
Pause
Pause the current execution and wait for approval (either by humans or other automated processes).
yaml
type: "io.kestra.plugin.core.flow.Pause"Examples
yaml
id: human_in_the_loop
namespace: company.team
tasks:
- id: before_approval
type: io.kestra.plugin.core.debug.Return
format: Output data that needs to be validated by a human
- id: pause
type: io.kestra.plugin.core.flow.Pause
- id: run_post_approval
type: io.kestra.plugin.scripts.shell.Commands
taskRunner:
type: io.kestra.plugin.core.runner.Process
commands:
- echo "Manual approval received! Continuing the execution..."
- id: post_resume
type: io.kestra.plugin.core.debug.Return
format: "{{ task.id }} started on {{ taskrun.startDate }} after the Pause"
yaml
id: vacation_approval_process
namespace: company.team
inputs:
- id: request.name
type: STRING
defaults: Rick Astley
- id: request.start_date
type: DATE
defaults: 2042-07-01
- id: request.end_date
type: DATE
defaults: 2042-07-07
- id: slack_webhook_uri
type: URI
defaults: https://reqres.in/api/slack
tasks:
- id: send_approval_request
type: io.kestra.plugin.notifications.slack.SlackIncomingWebhook
url: "{{ inputs.slack_webhook_uri }}"
payload: |
{
"channel": "#vacation",
"text": "Validate holiday request for {{ inputs.request.name }}. To approve the request, click on the `Resume` button here http://localhost:28080/ui/executions/{{flow.namespace}}/{{flow.id}}/{{execution.id}}"
}
- id: wait_for_approval
type: io.kestra.plugin.core.flow.Pause
onResume:
- id: approved
description: Whether to approve the request
type: BOOLEAN
defaults: true
- id: reason
description: Reason for approval or rejection
type: STRING
defaults: Well-deserved vacation
- id: approve
type: io.kestra.plugin.core.http.Request
uri: https://reqres.in/api/products
method: POST
contentType: application/json
body: "{{ inputs.request }}"
- id: log
type: io.kestra.plugin.core.log.Log
message: Status is {{ outputs.wait_for_approval.onResume.reason }}. Process finished with {{ outputs.approve.body }}
yaml
id: pause_warn
namespace: company.team
tasks:
- id: pause
type: io.kestra.plugin.core.flow.Pause
pauseDuration: PT5M
behavior: WARN
- id: post_resume
type: io.kestra.plugin.core.debug.Return
format: "{{ task.id }} started on {{ taskrun.startDate }} after the Pause"
Properties
behavior string
Default
RESUMEPossible Values
RESUMEWARNCANCELFAILerrors Non-dynamicarray
finally Non-dynamicarray
onPause Non-dynamic
onResume Non-dynamic
pauseDuration string
Format
durationOutputs
onResume object
resumed
Definitions
io.kestra.plugin.core.flow.Pause-Resumed
bystring
onstring
Format
date-timetostring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED