Apache Flink MonitorJob

Apache Flink MonitorJob

Certified

Trigger on Flink job state

Polls a Flink job over REST and triggers a flow when it reaches a terminal state. Uses a 10s polling default and can fail the flow on FAILED states.

yaml
type: io.kestra.plugin.flink.MonitorJob

Monitor Flink job and trigger on completion

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

triggers:
  - id: job-monitor
    type: io.kestra.plugin.flink.MonitorJob
    restUrl: "http://flink-jobmanager:8081"
    jobId: "my-job-id-12345"
    interval: "PT30S"
    expectedTerminalStates:
      - "FINISHED"
      - "CANCELED"
    failOnError: true

tasks:
  - id: notify-completion
    type: io.kestra.plugin.core.log.Log
    message: "Flink job {{ trigger.jobId }} reached state: {{ trigger.finalState }}"
Properties

Job ID

ID of the Flink job to monitor.

Flink REST API URL

Base URL of the Flink REST API (e.g., http://flink-jobmanager: 8081).

Defaultfalse

Specifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.

SubTypestring

Expected terminal states

Job states treated as success. Defaults to ['FINISHED'].

Defaulttrue

Fail on error

Fail the trigger when the job reaches FAILED. If false, trigger still fires with success=false; defaults to true.

DefaultPT10S

Polling interval

Interval between job status checks (ISO-8601 duration, e.g., PT30S). Defaults to PT10S.

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

List of execution states after which a trigger should be stopped (a.k.a. disabled).

Defaulttrue

A condition that determines whether the trigger should run.

A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.