CancelJob​Cancel​Job

Cancel a running Flink job.

This task cancels a running Flink job. Optionally, it can trigger a savepoint before cancellation to preserve the job state.

yaml
type: "io.kestra.plugin.flink.CancelJob"

Cancel a job with savepoint

yaml
id: cancel-flink-job
namespace: company.team

tasks:
  - id: cancel-job
    type: io.kestra.plugin.flink.CancelJob
    restUrl: "http://flink-jobmanager:8081"
    jobId: "{{ inputs.jobId }}"
    withSavepoint: true
    savepointDir: "s3://flink/savepoints/canceled/{{ execution.id }}"
    drainJob: true

Force cancel without savepoint

yaml
id: force-cancel-job
namespace: company.team

tasks:
  - id: force-cancel
    type: io.kestra.plugin.flink.CancelJob
    restUrl: "http://flink-jobmanager:8081"
    jobId: "{{ inputs.jobId }}"
    withSavepoint: false
Properties

Job ID

The ID of the Flink job to cancel

Flink REST API URL

The base URL of the Flink cluster's REST API, e.g., 'http://flink-jobmanager: 8081'

Default 60

Cancellation timeout

Maximum time to wait for cancellation to complete in seconds. Defaults to 60.

Default false

Drain job

Whether to drain the job (process all remaining input) before cancellation. Only applicable for streaming jobs. Defaults to false.

Savepoint directory

Target directory for the savepoint. Required if withSavepoint is true.

Default false

Create savepoint before cancellation

Whether to trigger a savepoint before canceling the job. Defaults to false.

Cancellation result

Result message from the cancellation operation

The cancelled job ID

The ID of the Flink job that was cancelled

Savepoint path

Path to the savepoint created before cancellation (if withSavepoint was true)