Skip to content

Commit 92f6a1d

Browse files
authored
Workflows 9.4 content — part A (#6048)
## Summary Adds documentation for the step categories, triggers, and authoring patterns that ship in Workflows 9.4 GA. Follow-up to the IA restructure ([#5950](#5950)). All schemas in this PR were cross-checked against the Kibana source of truth ([`elastic/kibana`](https://github.com/elastic/kibana) `workflows_execution_engine`, `workflows_extensions`, `cases`, and `agent_builder` plugins). ## What's new **11 new reference and how-to pages:** | Page | Covers | |---|---| | `steps/cases.md` | All 27 `cases.*` step types | | `steps/data.md` | 11 `data.*` transformation steps | | `steps/streams.md` | 3 `kibana.streams.*` steps (tech preview) | | `steps/composition.md` | `workflow.execute`, `workflow.executeAsync`, `workflow.output`, `workflow.fail` (tech preview) | | `steps/while.md` | `while` step | | `steps/switch.md` | `switch` step | | `steps/loop-break.md` | `loop.break` step | | `steps/loop-continue.md` | `loop.continue` step | | `steps/wait-for-input.md` | `waitForInput` step | | `triggers/event-driven-triggers.md` | `workflows.failed` trigger (tech preview) | | `authoring-techniques/human-in-the-loop.md` | HITL pattern using `waitForInput` + resume API | | `authoring-techniques/migrate-from-9.3.md` | 9.3 → 9.4 migration guide | **Expansions to existing pages:** - `steps/ai-steps.md` — adds `ai.classify` and `ai.summarize` as first-class step types; updates `ai.agent` with the `attachments` input parameter and the correct output shape (`message` / `structured_output` / `conversation_id`). - `steps/kibana.md` — documents `kibana.SetAlertsStatus` (all 5 body params) and `kibana.SetAlertTags` with their PascalCase type IDs; lists the deprecated Case aliases. - `steps/flow-control-steps.md` — restructured as an overview of all 8 flow-control types with links to per-step child pages. - `steps/action-steps.md` and `steps.md` — add Cases, Streams, Data, and Composition to the step-category overview. - `triggers.md` — adds event-driven trigger section. ## Open questions for reviewers - **SME check requested on `workflows.failed`**: Does this trigger support `on.condition` KQL filtering? The PM docs reference it, but the common trigger schema doesn't currently expose it. If the filter exists elsewhere in the registration pipeline, we'll add a filter section to `triggers/event-driven-triggers.md`. /cc @shahargl - **Resume API body shape on `waitForInput`**: The Kibana README example shows direct output access (`steps.<name>.output.approvedBy`). PM docs said the resume API wraps the body in `{ "input": ... }`. The HITL page uses the README's direct-access form with a `%` comment flagging this. Please confirm which is accurate before merge. - **Cases step schemas beyond the five I read directly** (`createCase`, `setCustomField`, `createCaseFromTemplate`, `updateCase`, `findCases`, `addAlerts`, `addObservables`, plus the shared config): parameters for the other 20 are adapted from PM docs. Engineering confirmation appreciated, especially on `cases.findCases` query fields and `cases.updateObservable`. ## How to review 1. **Nav diff**: See `explore-analyze/toc.yml` lines 464–494 for the new IA shape. 2. **Big pages to read carefully**: `steps/cases.md` (27 sections), `triggers/event-driven-triggers.md` (schema rewrite), `authoring-techniques/migrate-from-9.3.md`. 3. **Small, mechanical changes**: `applies_to` bumps from `preview 9.3` → `ga 9.4` across ~20 existing files. ## Test plan - [ ] Docs build passes with no broken internal links - [ ] All 44 toc-referenced files resolve - [ ] No Vale errors (warnings are false positives for Vale regex matching "etc" inside "Fetch" / "getSignificantEvents") - [ ] Nastasha: structural and style review - [ ] Tinsae: confirm the new `cases.*`, `data.*`, and `composition` content reflects the 9.4 GA product - [ ] Engineering: resolve the two SME questions above ## Out of scope (for PR B and PR C) - End-to-end pattern tutorials (alert→enrich→case, approval-gated remediation, and so on) — PR B, as children under the Use cases outcome sections. - Reference lookup content: cheat sheet, step type A–Z index, full context variables reference, Liquid filters reference, glossary, troubleshooting FAQ — PR C. - Anatomy of a workflow page, Settings page, enhanced error handling — PR C. ## Related - Parent IA restructure: #5950 - PM internal docset (private, Elastic-only): elastic/workflows-internal-docs - Kibana workflows plugins: `src/platform/plugins/shared/{workflows_execution_engine,workflows_management,workflows_extensions}`; `x-pack/platform/plugins/shared/cases/common/workflows/steps/`; `x-pack/platform/plugins/shared/agent_builder/common/step_types/` ## Generative AI disclosure 1. Did you use a generative AI (GenAI) tool to assist in creating this contribution? - [x ] Yes — Claude 4.7 / Cursor - [ ] No
1 parent ddc5592 commit 92f6a1d

45 files changed

Lines changed: 2816 additions & 252 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

explore-analyze/toc.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,28 +471,40 @@ toc:
471471
children:
472472
- file: workflows/authoring-techniques/use-yaml-editor.md
473473
- file: workflows/authoring-techniques/pass-data-handle-errors.md
474+
- file: workflows/authoring-techniques/human-in-the-loop.md
474475
- file: workflows/authoring-techniques/monitor-workflows.md
475476
- file: workflows/authoring-techniques/manage-workflows.md
477+
- file: workflows/authoring-techniques/migrate-from-9.3.md
476478
- file: workflows/reference.md
477479
children:
478480
- file: workflows/triggers.md
479481
children:
480482
- file: workflows/triggers/manual-triggers.md
481483
- file: workflows/triggers/scheduled-triggers.md
482484
- file: workflows/triggers/alert-triggers.md
485+
- file: workflows/triggers/event-driven-triggers.md
483486
- file: workflows/steps.md
484487
children:
485488
- file: workflows/steps/action-steps.md
486489
children:
487490
- file: workflows/steps/elasticsearch.md
488491
- file: workflows/steps/kibana.md
492+
- file: workflows/steps/cases.md
493+
- file: workflows/steps/streams.md
489494
- file: workflows/steps/external-systems-apps.md
490495
- file: workflows/steps/flow-control-steps.md
491496
children:
492497
- file: workflows/steps/if.md
493498
- file: workflows/steps/foreach.md
499+
- file: workflows/steps/while.md
500+
- file: workflows/steps/switch.md
494501
- file: workflows/steps/wait.md
502+
- file: workflows/steps/wait-for-input.md
503+
- file: workflows/steps/loop-break.md
504+
- file: workflows/steps/loop-continue.md
495505
- file: workflows/steps/ai-steps.md
506+
- file: workflows/steps/data.md
507+
- file: workflows/steps/composition.md
496508
- file: workflows/templating.md
497509
- file: workflows/templates.md
498510
- file: numeral-formatting.md

explore-analyze/workflows.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
applies_to:
3-
stack: preview 9.3
4-
serverless: preview
3+
stack: preview 9.3, ga 9.4+
4+
serverless: ga
55
description: Build automated workflows in Kibana to turn data insights into action.
66
products:
77
- id: kibana

explore-analyze/workflows/authoring-techniques.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
navigation_title: Workflow authoring techniques
33
applies_to:
4-
stack: preview 9.3
5-
serverless: preview
4+
stack: preview 9.3, ga 9.4+
5+
serverless: ga
66
description: Techniques for authoring, running, monitoring, and organizing Elastic Workflows.
77
products:
88
- id: kibana
@@ -19,8 +19,10 @@ Techniques that apply across workflow types, regardless of which outcome you're
1919

2020
- [Use the YAML editor](/explore-analyze/workflows/authoring-techniques/use-yaml-editor.md): Author and run workflows in the YAML editor in {{kib}}.
2121
- [Pass data and handle errors](/explore-analyze/workflows/authoring-techniques/pass-data-handle-errors.md): Move data between steps, use dynamic templating, and make workflows resilient with `on-failure`.
22+
- [Human-in-the-loop](/explore-analyze/workflows/authoring-techniques/human-in-the-loop.md): Pause a workflow for reviewer input and resume on their decision.
2223
- [Monitor workflow execution](/explore-analyze/workflows/authoring-techniques/monitor-workflows.md): Track runs, review execution history, and troubleshoot failures.
2324
- [Manage and organize workflows](/explore-analyze/workflows/authoring-techniques/manage-workflows.md): Find, edit, duplicate, enable, and disable workflows from the **Workflows** page.
25+
- [Migrate workflows from 9.3 to 9.4](/explore-analyze/workflows/authoring-techniques/migrate-from-9.3.md): Side-by-side replacements for the deprecated Case aliases, HTTP step `timeout` relocation, and scheduled-trigger minimum interval.
2426

2527
% Ben Ironside Goldstein, 2026-04-16: Follow-up PRs per Vision doc Section 7 will split pass-data-handle-errors.md
2628
% into separate how-tos (Pass data between steps, Handle errors and retries, Use constants and inputs)
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
---
2+
navigation_title: Human-in-the-loop
3+
applies_to:
4+
stack: ga 9.4+
5+
serverless: ga
6+
description: Pause a workflow to wait for human input, then resume with the reviewer's decision using the waitForInput step.
7+
products:
8+
- id: kibana
9+
- id: cloud-serverless
10+
- id: cloud-hosted
11+
- id: cloud-enterprise
12+
- id: cloud-kubernetes
13+
- id: elastic-stack
14+
---
15+
16+
# Human-in-the-loop workflows [workflows-human-in-the-loop]
17+
18+
Not every decision should be fully automated. *Human-in-the-loop* (HITL) is the pattern where a workflow pauses at a critical decision point, presents structured findings to a reviewer, waits for their input, and then resumes based on that input. It lets you combine the reach of automation with human judgment where judgment matters most.
19+
20+
## When to reach for HITL
21+
22+
- **Remediation with potential impact.** Isolating a host, blocking a user, or deleting data. Pause for analyst approval before the destructive action.
23+
- **Ambiguous classifications.** When an AI or rule is uncertain, ask a human before proceeding.
24+
- **Escalation gates.** Page an on-call, wait for acknowledgement and decision, then route accordingly.
25+
- **Approval for automation.** A new workflow in test mode can pause and ask for approval on each action for the first few runs, then switch to full automation once trusted.
26+
27+
## The mechanism: `waitForInput`
28+
29+
HITL is built on one step type: [`waitForInput`](/explore-analyze/workflows/steps/flow-control-steps.md#waitforinput). When the workflow reaches it, execution pauses. The reviewer sees the message (optionally with a form generated from a JSON Schema). When they respond, the workflow resumes with their input available as `steps.<step_name>.output`.
30+
31+
## Design a good HITL form
32+
33+
A HITL message is read by a human mid-incident. Design for speed:
34+
35+
- **Lead with the decision.** The first line should say what the reviewer needs to decide.
36+
- **Include the evidence.** Relevant context (alert details, enrichment results, AI rationale) belongs in the message so the reviewer doesn't have to dig.
37+
- **Keep the schema small.** Three fields is a lot. One boolean plus an optional notes field is often enough.
38+
- **Use Markdown.** The message supports Markdown, so use headings, bold text, and bullets to make it scannable.
39+
40+
## Write a HITL workflow
41+
42+
The three ingredients: a preceding step that gathers context, a `waitForInput` step that presents it, and subsequent steps that branch on the reviewer's decision.
43+
44+
```yaml
45+
name: isolate-host-with-approval
46+
enabled: true
47+
48+
triggers:
49+
- type: alert
50+
51+
steps:
52+
- name: open_case
53+
type: cases.createCase
54+
with:
55+
title: "Potential compromise: {{ event.alerts[0].host.name }}"
56+
severity: high
57+
tags: ["auto-triage"]
58+
59+
- name: investigate
60+
type: elasticsearch.search
61+
with:
62+
index: "logs-*"
63+
query:
64+
term:
65+
"host.name": "{{ event.alerts[0].host.name }}"
66+
67+
- name: classify
68+
type: ai.classify
69+
connector-id: "my-openai"
70+
with:
71+
input: "${{ steps.investigate.output.hits.hits }}"
72+
categories: ["confirmed_compromise", "likely_benign", "needs_review"]
73+
includeRationale: true
74+
75+
- name: review
76+
type: waitForInput
77+
with:
78+
message: |
79+
## Alert on `{{ event.alerts[0].host.name }}`
80+
81+
**AI classification:** {{ steps.classify.output.category }}
82+
83+
**Rationale:** {{ steps.classify.output.rationale }}
84+
85+
Isolate this host?
86+
schema:
87+
type: object
88+
properties:
89+
approved:
90+
type: boolean
91+
title: "Isolate the host"
92+
notes:
93+
type: string
94+
title: "Analyst notes"
95+
required: ["approved"]
96+
97+
- name: isolate
98+
type: http
99+
if: "steps.review.output.approved : true"
100+
connector-id: "edr-connector"
101+
with:
102+
method: "POST"
103+
url: "https://edr.example.com/isolate"
104+
body:
105+
host: "{{ event.alerts[0].host.name }}"
106+
reason: "{{ steps.review.output.notes }}"
107+
108+
- name: record_decision
109+
type: cases.addComment
110+
with:
111+
case_id: "{{ steps.open_case.output.case.id }}"
112+
comment: |
113+
**Decision:** {{ steps.review.output.approved ? "isolated" : "no action" }}
114+
**Notes:** {{ steps.review.output.notes }}
115+
```
116+
117+
Execution pauses at `review`. Until a reviewer responds, the execution state is `WAITING_FOR_INPUT`. When they respond, execution resumes at `isolate`, which is gated by an `if` guard on the approval decision.
118+
119+
## Resume a paused workflow
120+
121+
Resume a paused workflow using the following methods.
122+
123+
### From the Kibana UI
124+
125+
Open the execution view. The paused step renders a form generated from the `schema`. Fill it in, submit, and the workflow resumes.
126+
127+
### From the API
128+
129+
Send a `POST` request to the resume endpoint with the reviewer's input:
130+
131+
```http
132+
POST /api/workflowExecutions/{executionId}/resume
133+
Content-Type: application/json
134+
135+
{
136+
"approved": true,
137+
"notes": "Confirmed malicious. Proceeding with isolation."
138+
}
139+
```
140+
141+
The input body is available to subsequent steps as `steps.<step_name>.output`. Reference individual fields like `{{ steps.review.output.approved }}` and `{{ steps.review.output.notes }}`.
142+
143+
## What happens while the workflow is paused
144+
145+
- The execution is in the `WAITING_FOR_INPUT` state. It appears in the execution history with a resume action.
146+
- There's no default timeout on `waitForInput`. The workflow waits indefinitely. To limit the wait, set a workflow-level `settings.timeout`.
147+
- If the workflow-level `settings.timeout` elapses before the reviewer responds, the execution is cancelled.
148+
149+
## Related
150+
151+
- [`waitForInput` step reference](/explore-analyze/workflows/steps/flow-control-steps.md#waitforinput): Step parameter details.
152+
- [AI steps](/explore-analyze/workflows/steps/ai-steps.md): Pair AI classification or summarization with HITL for uncertain cases.
153+
- [Cases action steps](/explore-analyze/workflows/steps/cases.md): Record decisions and outcomes on the case.
154+
155+
% Ben Ironside Goldstein, 2026-04-16: The Kibana source README for wait_for_input_step shows the
156+
% output being accessed directly (e.g., steps.review.output.approved). PM internal docs claimed the
157+
% resume API wraps the body in { "input": ... }. Using the Kibana README's direct-access form here;
158+
% if engineering confirms the wrapped form is correct, update the API example above.

explore-analyze/workflows/authoring-techniques/manage-workflows.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
navigation_title: Manage and organize workflows
33
applies_to:
4-
stack: preview 9.3
5-
serverless: preview
4+
stack: preview 9.3, ga 9.4+
5+
serverless: ga
66
description: Find, edit, duplicate, enable, disable, and run workflows from the Workflows page in Kibana.
77
products:
88
- id: kibana

0 commit comments

Comments
 (0)