TriggerDagRun TriggerDagRun

yaml
type: "io.kestra.plugin.airflow.dags.TriggerDagRun"

Trigger an Airflow DAG with custom inputs and wait for its completion.

Launch a DAG run, optionally wait for its completion and return the final state of the DAG run.

Examples

Trigger a DAG run with custom inputs, and authenticate with basic authentication

yaml
id: airflow
namespace: company.team

tasks:
  - id: run_dag
    type: io.kestra.plugin.airflow.dags.TriggerDagRun
    baseUrl: http://host.docker.internal:8080
    dagId: example_astronauts
    wait: true
    pollFrequency: PT1S
    options:
      basicAuthUser: "{{ secret('AIRFLOW_USERNAME') }}"
      basicAuthPassword: "{{ secret('AIRFLOW_PASSWORD') }}"
    body:
      conf:
        source: kestra
        namespace: "{{ flow.namespace }}"
        flow: "{{ flow.id }}"
        task: "{{ task.id }}"
        execution: "{{ execution.id }}"

Trigger a DAG run with custom inputs, and authenticate with a Bearer token

yaml
id: airflow_header_authorization
namespace: company.team

tasks:
  - id: run_dag
    type: io.kestra.plugin.airflow.dags.TriggerDagRun
    baseUrl: http://host.docker.internal:8080
    dagId: example_astronauts
    wait: true
    headers:
      authorization: "Bearer {{ secret('AIRFLOW_TOKEN') }}"

Properties

baseUrl

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️

The base URL of the Airflow instance

dagId

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️

The ID of the DAG to trigger

body

  • Type: object
  • Dynamic:
  • Required:

Overrides the default configuration payload

headers

  • Type: object
  • SubType: string
  • Dynamic:
  • Required:

Adds custom headers

jobId

  • Type: string
  • Dynamic: ✔️
  • Required:

The job ID to check status for.

maxDuration

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

The maximum total wait duration.

options

Request options

pollFrequency

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

Specify how often the task should poll for the DAG run status.

wait

  • Type: boolean
  • Dynamic:
  • Required:
  • Default: false

Whether task should wait for the DAG to run to completion

Default value is false

Outputs

dagId

  • Type: string
  • Dynamic:
  • Required:

DAG ID

dagRunId

  • Type: string
  • Dynamic:
  • Required:

DAG run ID

ended

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

DAG run completed date

started

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

DAG run started date

state

  • Type: string
  • Dynamic:
  • Required:

State

Definitions

java.nio.charset.Charset

Properties

io.kestra.plugin.core.http.HttpInterface-RequestOptions

Properties

basicAuthPassword
  • Type: string
  • Dynamic: ✔️
  • Required:

The HTTP basic authentication password.

basicAuthUser
  • Type: string
  • Dynamic: ✔️
  • Required:

The HTTP basic authentication username.

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

The connect timeout.

connectionPoolIdleTimeout
  • Type: string
  • Dynamic:
  • Required:
  • Default: 0.0
  • Format: duration

The idle timeout for connection in the client connection pool.

defaultCharset
  • Type: Charset
  • Dynamic:
  • Required:
  • Default: UTF-8

The default charset.

followRedirects
  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

Whether redirects should be followed.

logLevel
  • Type: string
  • Dynamic:
  • Required:
  • Possible Values:
    • ALL
    • TRACE
    • DEBUG
    • INFO
    • WARN
    • ERROR
    • OFF
    • NOT_SPECIFIED

The log level.

maxContentLength
  • Type: integer
  • Dynamic:
  • Required:
  • Default: 10485760

The maximum content length of the response

proxyAddress
  • Type: string
  • Dynamic: ✔️
  • Required:

The proxy address.

proxyPassword
  • Type: string
  • Dynamic: ✔️
  • Required:

The proxy password.

proxyPort
  • Type: integer
  • Dynamic:
  • Required:

The proxy port.

proxyType
  • Type: string
  • Dynamic:
  • Required:
  • Default: DIRECT
  • Possible Values:
    • DIRECT
    • HTTP
    • SOCKS

The proxy type.

proxyUsername
  • Type: string
  • Dynamic: ✔️
  • Required:

The proxy username.

readIdleTimeout
  • Type: string
  • Dynamic:
  • Required:
  • Default: 300.000000000
  • Format: duration

The default amount of time to allow the read connection to remain idle.

readTimeout
  • Type: string
  • Dynamic:
  • Required:
  • Default: 10.000000000
  • Format: duration

The default read timeout.

Was this page helpful?