
Kestra Plugin Count
CertifiedCount executions by filters
Kestra Plugin Count
Count executions by filters
Counts executions matching namespace, flow, state, and date filters. Optional expression can zero-out the result when the rendered condition is not true.
type: io.kestra.plugin.kestra.executions.CountExamples
Count successful executions in a namespace
id: count_success_executions
namespace: company.team
tasks:
- id: count_success
type: io.kestra.plugin.kestra.executions.Count
kestraUrl: http://localhost:8080
auth:
username: "{{ secret('KESTRA_USERNAME') }}"
password: "{{ secret('KESTRA_PASSWORD') }}"
namespaces:
- company.team
states:
- SUCCESS
startDate: "{{ now() | dateAdd(-7, 'DAYS') }}"
endDate: "{{ now() }}"
expression: "{{ count >= 0 }}"
- id: log_result
type: io.kestra.plugin.core.log.Log
message: |
Execution count check completed.
Matching executions: {{ outputs.count_success.count }}
Properties
auth Non-dynamic
Select API authentication
Use either an API token or HTTP Basic (username/password); do not provide both.
io.kestra.plugin.kestra.AbstractKestraTask-Auth
API token for bearer auth
trueAutomatically 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-tokento use an API token - Set
kestra.tasks.sdk.authentication.usernameandkestra.tasks.sdk.authentication.passwordfor HTTP basic authentication The Enterprise edition also provides setting a default configuration at the Namespace of Tenant level by an administrator.
Password for HTTP Basic auth
Username for HTTP Basic auth
endDate string
End date
Counts executions up to this date.
expression string
Expression evaluated on count
Rendered with variable count; if the expression does not return true, the exposed count is set to 0. Example: {{ gte count 5 }}.
flowId string
Flow id filter
kestraUrl string
Override Kestra API endpoint
URL used for calls to the Kestra API. When null, renders {{ kestra.url }} from configuration; if still empty, defaults to http://localhost: 8080. Trailing slashes are stripped before use.
namespaces array
Namespaces filter
Limit the search to these namespaces; leave empty for all.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
startDate string
Start date
Counts executions starting from this date.
states array
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDUNKNOWN_DEFAULT_OPEN_APIExecution states
Only count executions currently in these states.
tenantId string
Override target tenant
Tenant identifier applied to API calls; defaults to the current execution tenant.
Outputs
count integer
Execution count
The total number of executions.