CancelJob
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.
type: "io.kestra.plugin.flink.CancelJob"Examples
Cancel a job with savepoint
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
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
jobId *Requiredstring
Job ID
The ID of the Flink job to cancel
restUrl *Requiredstring
Flink REST API URL
The base URL of the Flink cluster's REST API, e.g., 'http://flink-jobmanager: 8081'
cancellationTimeout integerstring
60Cancellation timeout
Maximum time to wait for cancellation to complete in seconds. Defaults to 60.
drainJob booleanstring
falseDrain job
Whether to drain the job (process all remaining input) before cancellation. Only applicable for streaming jobs. Defaults to false.
savepointDir string
Savepoint directory
Target directory for the savepoint. Required if withSavepoint is true.
withSavepoint booleanstring
falseCreate savepoint before cancellation
Whether to trigger a savepoint before canceling the job. Defaults to false.
Outputs
cancellationResult string
Cancellation result
Result message from the cancellation operation
jobId string
The cancelled job ID
The ID of the Flink job that was cancelled
savepointPath string
Savepoint path
Path to the savepoint created before cancellation (if withSavepoint was true)