Kestra Executions Query

Kestra Executions Query

Certified

Search executions with filters

Queries executions by namespace, flow, labels, states, date range, or scope. Defaults to fetch all pages with page size 10 and stores results to internal storage unless fetchType overrides.

yaml
type: io.kestra.plugin.kestra.executions.Query

Search for executions with a specific label

yaml
id: search_executions_by_label
namespace: company.team

tasks:
  - id: query
    type: io.kestra.plugin.kestra.executions.Query
    kestraUrl: http://localhost:8080
    labels:
      key: value
    auth:
      username: "{{ secret('KESTRA_USERNAME') }}"
      password: "{{ secret('KESTRA_PASSWORD') }}"
    fetchType: STORE # Store the results in a file

Search for successful executions in the last 10 hours

yaml
id: search_successful_executions
namespace: company.team

tasks:
  - id: search_executions
    type: io.kestra.plugin.kestra.executions.Query
    kestraUrl: http://localhost:8080
    auth:
      username: "{{ secret('KESTRA_USERNAME') }}"
      password: "{{ secret('KESTRA_PASSWORD') }}"
    timeRange: PT10H # In the last 10 hours
    states:
      - SUCCESS
    fetchType: FETCH # Fetch the results directly in the task output
Properties

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

Select API authentication

Use either an API token or HTTP Basic (username/password); do not provide both.

Definitions
apiTokenstring

API token for bearer auth

autobooleanstring
Defaulttrue

Automatically retrieve credentials from Kestra's configuration if available

The default configuration can be configured globally inside the Kestra configuration file:

  • Set kestra.tasks.sdk.authentication.api-token to use an API token
  • Set kestra.tasks.sdk.authentication.username and kestra.tasks.sdk.authentication.password for HTTP basic authentication
  • Set kestra.tasks.sdk.authentication.url to also default the Kestra API endpoint (see kestraUrl above) The Enterprise edition also provides setting a default configuration at the Namespace or Tenant level by an administrator. Set to false to also opt out of the default URL, and to call a Kestra API that requires no authentication when no credentials are set either.
passwordstring

Password for HTTP Basic auth

usernamestring

Username for HTTP Basic auth

Possible Values
CHILDMAIN

Child filter

Limits results to child execution context when set.

End date (inclusive)

DefaultSTORE
Possible Values
STOREFETCHFETCH_ONENONE

Fetch strategy

Defaults to STORE (writes to internal storage and returns URI). FETCH returns rows in output; FETCH_ONE returns the first execution.

Flow id filter

SubTypestring
Possible Values
USERSYSTEM

Flow scope filter

USER for user-created executions, SYSTEM for system executions; defaults to both.

Override Kestra API endpoint

URL used for calls to the Kestra API. When null, falls back to the url configured alongside the default SDK authentication (Namespace or Tenant level, Enterprise edition), then renders {{ kestra.url }} from configuration; if still empty, defaults to http://localhost: 8080. Trailing slashes are stripped before use.

Labels filter

Matches executions containing the provided key/value pairs.

Namespace filter

Page number

When null, iterates through all pages. Combine with size to limit requests.

Default10

Page size

Defaults to 10.

Start date (inclusive)

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDUNKNOWN_DEFAULT_OPEN_API

Execution states

Override target tenant

Tenant identifier applied to API calls; defaults to the current execution tenant.

Relative time range

Duration back from now. Cannot be used with both startDate and endDate.

Downstream of execution ID

Map containing the first row of fetched data.

Only populated if using fetchType=FETCH_ONE.

List containing the fetched data.

Only populated if using fetchType=FETCH.

The number of fetched rows.

Formaturi

Kestra's internal storage URI of the stored data.

Only populated if using fetchType=STORE.