Kestra Plugin CreateCase

Kestra Plugin CreateCase

Certified

Open an incident-management Case, or attach the current execution to an already-open matching one

Creates a new Case in Kestra's incident-management feature, typically from an errors: task so an incident is opened whenever a flow fails. The execution that triggered the task is automatically linked to the case.

When linkMatchingExecutions is true, the task first looks for an active (non-resolved, non-cancelled) case previously created by this same task (same flow + task id), or with the same deduplicationKey when one is set; if one is found, the triggering execution is attached to it instead of creating a new case.

yaml
type: io.kestra.plugin.kestra.ee.cases.CreateCase

Open a case when a flow fails.

yaml
id: health_check
namespace: company.team

tasks:
  - id: check
    type: io.kestra.plugin.core.http.Request
    uri: https://example.com/health

errors:
  - id: open_incident
    type: io.kestra.plugin.kestra.ee.cases.CreateCase
    title: "{{ execution.id }} failed for {{ flow.id }}"
    caseDescription: "Health check failed."
    severity: CRITICAL
    sla:
      acknowledgement: PT1H
      resolution: PT8H
    linkMatchingExecutions: true
    assignees:
      users:
        - a@b.c
      groups:
        - Admins

Open one case per failing flow from a system flow, grouping executions on a deduplication key.

yaml
id: open_case_on_failure
namespace: system

triggers:
  - id: on_failure
    type: io.kestra.plugin.core.trigger.Flow
    dependsOn:
      - states: [FAILED]
        namespace: company.team

tasks:
  - id: open_case
    type: io.kestra.plugin.kestra.ee.cases.CreateCase
    title: "{{ trigger.namespace }}.{{ trigger.flowId }} failed"
    namespace: "{{ trigger.namespace }}"
    linkMatchingExecutions: true
    deduplicationKey: "{{ trigger.namespace }}.{{ trigger.flowId }}"
    executionId: "{{ trigger.executionId }}"
Properties

Actions attached to the case

System flows runnable directly from the case's detail page.

Definitions
flowIdstring

Id of the flow to run

labelstring

Display label for the action

namespacestring

Namespace of the flow to run

SubTypestring

Asset IDs to link to the case

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

Assignees

Definitions
groupsarray
SubTypestring

Group names

usersarray
SubTypestring

User emails

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

Case description

Supports Markdown.

Attach to an existing case instead of creating one

When set, the triggering execution is attached to this case id instead of creating a new case. Used by the auto-generated "keep attaching matching executions" system flow.

Key identifying which executions belong to the same case

Only used with linkMatchingExecutions. Executions of the tenant that render the same key are attached to the same active case, whatever flow or task they come from, so include a namespace in the key if you want one. Without a key, executions are grouped by the flow and task id of this task, which is only meaningful from an errors block. Fails when the key renders blank or longer than 250 characters.

The execution id to link

Defaults to the current task run's own triggering execution. Set this to {{ trigger.executionId }} when this task runs inside a Flow-trigger-driven system flow (e.g. the auto-generated "keep attaching matching executions" flow), so the upstream triggering execution is linked instead of the system flow's own execution.

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 to attach to the case

Labels as a list of Label (key/value pairs) or as a map of string to string.

Defaultfalse

Attach to a matching open case instead of creating a new one

When true, looks for an active (non-resolved, non-cancelled) case previously created by this same task, or with the same deduplicationKey when one is set, and attaches the triggering execution to it instead of creating a new case.

Namespace the case belongs to

Defaults to the flow's namespace.

Possible Values
CRITICALHIGHMEDIUMLOWUNKNOWN_DEFAULT_OPEN_API

Case severity

Defaults to MEDIUM if not set.

SLA targets for the case

Definitions
acknowledgementstring

Time to acknowledge, counted from case creation

resolutionstring

Time to resolve, counted from case creation

DefaultOPEN
Possible Values
OPENACKNOWLEDGEDINVESTIGATINGRESOLVEDCANCELLEDUNKNOWN_DEFAULT_OPEN_API

Initial case status

Defaults to OPEN.

Override target tenant

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

Case title

Required unless caseId is set (attaching to an existing case doesn't need a new title).

Watchers

Definitions
groupsarray
SubTypestring

Group names

usersarray
SubTypestring

User emails

The id of the case that was created or attached to

Whether a new case was created

false if the triggering execution was attached to an existing matching case instead.