Skip to content

[9.4] [One Workflow] Deprecate direct AI connector step types in favor of ai.prompt (#263694)#264354

Merged
Kiryous merged 1 commit intoelastic:9.4from
Kiryous:backport/9.4/pr-263694
Apr 20, 2026
Merged

[9.4] [One Workflow] Deprecate direct AI connector step types in favor of ai.prompt (#263694)#264354
Kiryous merged 1 commit intoelastic:9.4from
Kiryous:backport/9.4/pr-263694

Conversation

@Kiryous
Copy link
Copy Markdown
Contributor

@Kiryous Kiryous commented Apr 20, 2026

Backport

This will backport the following commits from main to 9.4:

Questions ?

Please refer to the Backport tool documentation

…i.prompt (elastic#263694)

## Summary

Extends the workflow step deprecation mechanism to support
**prefix-based matching** and deprecates all direct AI connector step
types (`inference.*`, `bedrock.*`, `gen-ai.*`, `gemini.*`) in favor of
the purpose-built `ai.prompt` step.

- Users were confused by the availability of raw AI connector steps
alongside the purpose-built `ai.*` steps ([Slack
thread](https://elastic.slack.com/archives/C08U04SUN49/p1776097440515239))
- Deprecated steps are hidden from autocomplete, the Add Action menu,
and AI agent discovery
- Existing workflows using these step types continue to work — they just
show a deprecation warning in the editor

### Changes

- Added `DEPRECATED_STEP_PREFIX_METADATA` to `@kbn/workflows` for
prefix-based deprecation matching
- Updated `getDeprecatedStepMetadata()` to check prefix matches after
exact matches
- Migrated all deprecation consumers from direct map access
(`deprecatedMap[key]`) to function calls
(`getDeprecatedStepMetadata(key)`)
- Updated the agent builder tool to detect prefix deprecation on dynamic
connector steps

### Screenshots

**Editor deprecation warnings** — `inference.completion` and
`bedrock.invokeAI` now show deprecation squiggles and hover tooltip:

| Before (main) | After |
|---|---|
|
![before](https://pub-6b50802d113345dea50c783e8280b53e.r2.dev/artifacts/20260416/s5rfd0ru-before_editor_nohover.webp)
|
![after](https://pub-6b50802d113345dea50c783e8280b53e.r2.dev/artifacts/20260416/lfqf2d0v-after_editor_nohover.webp)
|

**Deprecation hover tooltip** — hovering on a deprecated AI connector
step shows the replacement suggestion:

![deprecation
hover](https://pub-6b50802d113345dea50c783e8280b53e.r2.dev/artifacts/20260416/e93t9gse-after_editor_hover.webp)

**Autocomplete** — typing `inference` shows "No suggestions" (all
`inference.*` steps are filtered):

![autocomplete no
suggestions](https://pub-6b50802d113345dea50c783e8280b53e.r2.dev/artifacts/20260416/ldyuw3yh-test_autocomplete_inference.webp)

**Add Action menu** — searching for "inference" or "bedrock" returns no
options:

![actions menu
inference](https://pub-6b50802d113345dea50c783e8280b53e.r2.dev/artifacts/20260416/e1nwunw0-test_actions_menu_inference.webp)

**`ai.prompt` not affected** — searching "ai" in the actions menu still
shows AI Prompt, AI Classify, AI Summarize:

![actions menu
ai](https://pub-6b50802d113345dea50c783e8280b53e.r2.dev/artifacts/20260416/e1jpox1j-test_actions_menu_ai.webp)

**Exact-match deprecation still works** — `kibana.createCase` still
shows deprecation warning (existing behavior preserved):

![kibana cases
deprecation](https://pub-6b50802d113345dea50c783e8280b53e.r2.dev/artifacts/20260416/mnn2rrwx-test_kibana_cases_clean.webp)

Closes elastic/security-team#16816

## Test plan

- [x] Verify `inference.*`, `bedrock.*`, `gen-ai.*`, `gemini.*` steps no
longer appear in autocomplete suggestions
- [x] Verify these steps no longer appear in the Add Action menu
- [x] Verify existing workflows using these steps show a deprecation
warning in the editor
- [x] Verify `ai.prompt` step is not affected by the deprecation
- [x] Verify `kibana.*` Cases steps still show exact-match deprecation
warnings

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
(cherry picked from commit 9af9077)
@Kiryous Kiryous added the backport This PR is a backport of another PR label Apr 20, 2026
@Kiryous Kiryous requested a review from kibanamachine as a code owner April 20, 2026 09:53
@Kiryous Kiryous enabled auto-merge (squash) April 20, 2026 09:53
@botelastic botelastic Bot added the Team:One Workflow Team label for One Workflow (Workflow automation) label Apr 20, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Apr 20, 2026

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #87 / Endpoint plugin @ess @serverless @skipInServerlessMKI When attempting to call an endpoint api "before all" hook in "@ess @serverless @skipInServerlessMKI When attempting to call an endpoint api"
  • [job] [logs] FTR Configs #87 / Endpoint plugin @ess @serverless @skipInServerlessMKI When attempting to call an endpoint api "before all" hook in "@ess @serverless @skipInServerlessMKI When attempting to call an endpoint api"

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/workflows 588 592 +4

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
workflowsManagement 2.2MB 2.2MB +510.0B
Unknown metric groups

API count

id before after diff
@kbn/workflows 701 707 +6

History

@Kiryous Kiryous merged commit 7b33e5b into elastic:9.4 Apr 20, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:One Workflow Team label for One Workflow (Workflow automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants