Pause Pause

yaml
type: "io.kestra.plugin.core.flow.Pause"

Pause the current execution and wait for a manual approval (either by humans or other automated processes). All tasks downstream from the Pause task will be put on hold until the execution is manually resumed from the UI. The Execution will be in a Paused state (marked in purple) and you can manually resume it by clicking on the "Resume" button in the UI, or by calling the POST API endpoint "/api/v1/executions/{executionId}/resume". The execution can also be resumed automatically after a timeout.

Examples

Pause the execution and wait for a manual approval

yaml
id: human_in_the_loop
namespace: dev

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
    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"

Vacation approval process pausing the execution for approval and waiting for input from a human to approve or reject the request.

yaml
id: vacation_approval_process
namespace: dev

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 }}

Properties

delay

  • Type: string
  • Dynamic:
  • Required:
  • Format: duration

Duration of the pause — useful if you want to pause the execution for a fixed amount of time.

If no delay and no timeout are configured, the execution will never end until it's manually resumed from the UI or API.

errors

  • Type: array
  • SubType: Task
  • Dynamic:
  • Required:

List of tasks to run if any tasks failed on this FlowableTask.

onResume

  • Type: array
  • SubType:
  • Dynamic:
  • Required:

Inputs to be passed to the execution when it's resumed.

Before resuming the execution, the user will be prompted to fill in these inputs. The inputs can be used to pass additional data to the execution which is useful for human-in-the-loop scenarios. The onResume inputs work the same way as regular flow inputs — they can be of any type and can have default values. You can access those values in downstream tasks using the onResume output of the Pause task.

tasks

  • Type: array
  • SubType: Task
  • Dynamic:
  • Required:

timeout

  • Type: string
  • Dynamic:
  • Required:
  • Format: duration

Timeout of the pause — useful to avoid never-ending workflows in a human-in-the-loop scenario. For example, if you want to pause the execution until a human validates some data generated in a previous task, you can set a timeout of e.g. 24 hours. If no manual approval happens within 24 hours, the execution will automatically resume without a prior data validation.

If no delay and no timeout are configured, the execution will never end until it's manually resumed from the UI or API.

Outputs

onResume

  • Type: object
  • Dynamic:
  • Required:

Definitions

io.kestra.core.models.flows.input.BooleanInput

Properties

id
  • Type: string
  • Dynamic:
  • Required: ✔️
  • Validation regExp: ^[a-zA-Z0-9][.a-zA-Z0-9_-]*
  • Min length: 1
defaults
  • Type: object
  • Dynamic:
  • Required:
description
  • Type: string
  • Dynamic:
  • Required:
name
  • Type: string
  • Dynamic:
  • Required:
required
  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

io.kestra.core.models.flows.input.DurationInput

Properties

id
  • Type: string
  • Dynamic:
  • Required: ✔️
  • Validation regExp: ^[a-zA-Z0-9][.a-zA-Z0-9_-]*
  • Min length: 1
defaults
  • Type: object
  • Dynamic:
  • Required:
description
  • Type: string
  • Dynamic:
  • Required:
max
  • Type: string
  • Dynamic:
  • Required:
  • Format: duration

Maximal value.

min
  • Type: string
  • Dynamic:
  • Required:
  • Format: duration

Minimal value.

name
  • Type: string
  • Dynamic:
  • Required:
required
  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

io.kestra.core.models.flows.input.DateTimeInput

Properties

id
  • Type: string
  • Dynamic:
  • Required: ✔️
  • Validation regExp: ^[a-zA-Z0-9][.a-zA-Z0-9_-]*
  • Min length: 1
after
  • Type: string
  • Dynamic:
  • Required:
  • Format: date-time

Minimal value.

before
  • Type: string
  • Dynamic:
  • Required:
  • Format: date-time

Maximal value.

defaults
  • Type: object
  • Dynamic:
  • Required:
description
  • Type: string
  • Dynamic:
  • Required:
name
  • Type: string
  • Dynamic:
  • Required:
required
  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

io.kestra.core.models.flows.input.EnumInput

Properties

id
  • Type: string
  • Dynamic:
  • Required: ✔️
  • Validation regExp: ^[a-zA-Z0-9][.a-zA-Z0-9_-]*
  • Min length: 1
values
  • Type: array
  • SubType: string
  • Dynamic:
  • Required: ✔️

List of values.

defaults
  • Type: object
  • Dynamic:
  • Required:
description
  • Type: string
  • Dynamic:
  • Required:
name
  • Type: string
  • Dynamic:
  • Required:
required
  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

io.kestra.core.models.flows.input.TimeInput

Properties

id
  • Type: string
  • Dynamic:
  • Required: ✔️
  • Validation regExp: ^[a-zA-Z0-9][.a-zA-Z0-9_-]*
  • Min length: 1
after
  • Type: string
  • Dynamic:
  • Required:
  • Format: time

Minimal value.

before
  • Type: string
  • Dynamic:
  • Required:
  • Format: time

Maximal value.

defaults
  • Type: object
  • Dynamic:
  • Required:
description
  • Type: string
  • Dynamic:
  • Required:
name
  • Type: string
  • Dynamic:
  • Required:
required
  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

io.kestra.core.models.flows.input.StringInput

Properties

id
  • Type: string
  • Dynamic:
  • Required: ✔️
  • Validation regExp: ^[a-zA-Z0-9][.a-zA-Z0-9_-]*
  • Min length: 1
defaults
  • Type: object
  • Dynamic:
  • Required:
description
  • Type: string
  • Dynamic:
  • Required:
name
  • Type: string
  • Dynamic:
  • Required:
required
  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true
validator
  • Type: string
  • Dynamic:
  • Required:

Regular expression validating the value.

io.kestra.core.models.flows.input.DateInput

Properties

id
  • Type: string
  • Dynamic:
  • Required: ✔️
  • Validation regExp: ^[a-zA-Z0-9][.a-zA-Z0-9_-]*
  • Min length: 1
after
  • Type: string
  • Dynamic:
  • Required:
  • Format: date

Minimal value.

before
  • Type: string
  • Dynamic:
  • Required:
  • Format: date

Maximal value.

defaults
  • Type: object
  • Dynamic:
  • Required:
description
  • Type: string
  • Dynamic:
  • Required:
name
  • Type: string
  • Dynamic:
  • Required:
required
  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

io.kestra.core.models.flows.input.FloatInput

Properties

id
  • Type: string
  • Dynamic:
  • Required: ✔️
  • Validation regExp: ^[a-zA-Z0-9][.a-zA-Z0-9_-]*
  • Min length: 1
defaults
  • Type: object
  • Dynamic:
  • Required:
description
  • Type: string
  • Dynamic:
  • Required:
max
  • Type: number
  • Dynamic:
  • Required:

Maximal value.

min
  • Type: number
  • Dynamic:
  • Required:

Minimal value.

name
  • Type: string
  • Dynamic:
  • Required:
required
  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

io.kestra.core.models.flows.input.SecretInput

Properties

id
  • Type: string
  • Dynamic:
  • Required: ✔️
  • Validation regExp: ^[a-zA-Z0-9][.a-zA-Z0-9_-]*
  • Min length: 1
defaults
  • Type: object
  • Dynamic:
  • Required:
description
  • Type: string
  • Dynamic:
  • Required:
name
  • Type: string
  • Dynamic:
  • Required:
required
  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true
validator
  • Type: string
  • Dynamic:
  • Required:

Regular expression validating the value.

io.kestra.core.models.flows.input.IntInput

Properties

id
  • Type: string
  • Dynamic:
  • Required: ✔️
  • Validation regExp: ^[a-zA-Z0-9][.a-zA-Z0-9_-]*
  • Min length: 1
defaults
  • Type: object
  • Dynamic:
  • Required:
description
  • Type: string
  • Dynamic:
  • Required:
max
  • Type: integer
  • Dynamic:
  • Required:

Maximal value.

min
  • Type: integer
  • Dynamic:
  • Required:

Minimal value.

name
  • Type: string
  • Dynamic:
  • Required:
required
  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

io.kestra.core.models.flows.input.FileInput

Properties

id
  • Type: string
  • Dynamic:
  • Required: ✔️
  • Validation regExp: ^[a-zA-Z0-9][.a-zA-Z0-9_-]*
  • Min length: 1
defaults
  • Type: object
  • Dynamic:
  • Required:
description
  • Type: string
  • Dynamic:
  • Required:
extension
  • Type: string
  • Dynamic:
  • Required:
  • Default: .upl
name
  • Type: string
  • Dynamic:
  • Required:
required
  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

io.kestra.core.models.flows.input.JsonInput

Properties

id
  • Type: string
  • Dynamic:
  • Required: ✔️
  • Validation regExp: ^[a-zA-Z0-9][.a-zA-Z0-9_-]*
  • Min length: 1
defaults
  • Type: object
  • Dynamic:
  • Required:
description
  • Type: string
  • Dynamic:
  • Required:
name
  • Type: string
  • Dynamic:
  • Required:
required
  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

io.kestra.core.models.flows.input.ArrayInput

Properties

id
  • Type: string
  • Dynamic:
  • Required: ✔️
  • Validation regExp: ^[a-zA-Z0-9][.a-zA-Z0-9_-]*
  • Min length: 1
itemType
  • Type: string
  • Dynamic:
  • Required: ✔️
  • Possible Values:
    • STRING
    • ENUM
    • INT
    • FLOAT
    • BOOLEAN
    • DATETIME
    • DATE
    • TIME
    • DURATION
    • FILE
    • JSON
    • URI
    • SECRET
    • ARRAY

Type of the array items.

Cannot be of type ARRAY.

defaults
  • Type: object
  • Dynamic:
  • Required:
description
  • Type: string
  • Dynamic:
  • Required:
name
  • Type: string
  • Dynamic:
  • Required:
required
  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

io.kestra.core.models.flows.input.URIInput

Properties

id
  • Type: string
  • Dynamic:
  • Required: ✔️
  • Validation regExp: ^[a-zA-Z0-9][.a-zA-Z0-9_-]*
  • Min length: 1
defaults
  • Type: object
  • Dynamic:
  • Required:
description
  • Type: string
  • Dynamic:
  • Required:
name
  • Type: string
  • Dynamic:
  • Required:
required
  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

Was this page helpful?