Workflows
If you've been using the Keep HQ workflow docs, it's time to make the switch. Keep HQ's workflow docs are no longer maintained, and the Elastic workflow docs are now the source of truth for all up-to-date workflow documentation.
A workflow is a defined sequence of steps designed to achieve a specific outcome through automation. It's a reusable, versionable "recipe" that transforms inputs into actions.
Insight into your data isn't enough. The ultimate value lies in action and outcomes. Workflows complete the journey from data to insights to automated outcomes. Your critical operational data already lives in the Elastic cluster: security events, infrastructure metrics, application logs, and business context. Workflows let you automate end-to-end processes to achieve outcomes directly where that data lives, without needing external automation tools.
Workflows address common operational challenges, such as:
- Alert fatigue: Automate responses to reduce manual triage.
- Understaffing: Enable teams to do more with fewer resources.
- Manual, repetitive work: Automate routine tasks consistently.
- Tool fragmentation: Eliminate the need to add on external automation tools.
Workflows can handle a wide range of tasks, from simple, repeatable steps to complex processes.
Workflows are for you if you want to cut down on manual effort, speed up response times, and make sure recurring situations are handled consistently.
Some key concepts to understand while working with workflows:
- Triggers: The events or conditions that initiate a workflow. Refer to Triggers to learn more.
- Steps: The individual units of logic or action that make up a workflow. Refer to Steps to learn more.
- Data: How data flows through your workflow, including inputs, constants, context variables, step outputs, and Liquid templating for dynamic values. Refer to Pass data and handle errors to learn more.
Workflows are defined in YAML. In the YAML editor, describe what the workflow should do, and the platform handles execution.
# ═══════════════════════════════════════════════════════════════
# METADATA - Identifies and describes the workflow
# ═══════════════════════════════════════════════════════════════
name: My Workflow
description: What this workflow does
enabled: true
tags: ["demo", "production"]
# ═══════════════════════════════════════════════════════════════
# CONSTANTS - Reusable values defined once, used throughout
# ═══════════════════════════════════════════════════════════════
consts:
indexName: "my-index"
environment: "production"
alertThreshold: 100
endpoints: # Can be objects/arrays
api: "https://api.example.com"
backup: "https://backup.example.com"
# ═══════════════════════════════════════════════════════════════
# INPUTS - Parameters passed when the workflow is triggered
# ═══════════════════════════════════════════════════════════════
inputs:
- name: environment
type: string
required: true
default: "staging"
description: "Target environment"
- name: dryRun
type: boolean
default: true
# ═══════════════════════════════════════════════════════════════
# TRIGGERS - How/when the workflow starts
# ═══════════════════════════════════════════════════════════════
triggers:
- type: manual
# - type: scheduled
# with:
every: 1d
# - type: alert
# ═══════════════════════════════════════════════════════════════
# STEPS - The actual workflow logic (executed in order)
# ═══════════════════════════════════════════════════════════════
steps:
- name: step_one
type: elasticsearch.search
with:
index: "{{consts.indexName}}"
query:
match_all: {}
- name: step_two
type: console
with:
message: |
Environment: {{inputs.environment}}
Found: {{steps.step_one.output.hits.total.value}}
- Required: Unique identifier
- Optional: Shown in UI
- Optional: Enable or disable execution
- Optional: For organizing workflows
- User clicks Run button
- Runs on a schedule
- Triggered by an alert
- Reference constants
- Reference inputs
- Reference step output
Start here:
- Set up Workflows: Turn on the feature and configure role-based access.
- Build your first workflow: A hands-on tutorial using sample data.
Explore what you can automate:
- Use cases: Browse security, observability, and AI-augmented patterns you can build with workflows today.
Reference and authoring:
- Workflow authoring techniques: How to use the YAML editor, pass data between steps, and handle errors.
- Reference: Triggers, steps, and templating engine reference.
- Workflow templates: Pre-built workflows you can adapt.