[One Workflow] Deprecate direct AI connector step types in favor of ai.prompt#263694
Conversation
Extend the step deprecation mechanism to support prefix-based matching, deprecating all inference.*, bedrock.*, gen-ai.*, and gemini.* step types. Users are confused by the availability of raw AI connector steps alongside the purpose-built ai.* steps; this hides them from autocomplete, the action menu, and AI agent discovery while keeping them functional for existing workflows. Closes elastic/security-team#16816 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
semd
left a comment
There was a problem hiding this comment.
LGTM
Added some improvement suggestions below
The output size test was missing the getDeprecatedStepMetadata function in its jest.mock for common/schema, causing all 16 tests to fail with TypeError. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ution - Use `isDeprecatedStepType` boolean helper instead of `getDeprecatedStepMetadata` in get_action_options.ts and get_completion_item_provider.ts (NIT from semd) - Extract `getStepPrefixDeprecationInfo` from package's `getStepDeprecationInfo` so prefix-matching logic is reusable without duplication - Move prefix resolution into `getDeprecatedStepMetadataMap` so known connector types are cached, and use `getStepPrefixDeprecationInfo` as fallback in `getDeprecatedStepMetadata` to avoid duplicating the loop Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
History
cc @Kiryous |
|
Starting backport for target branches: 9.4 https://github.com/elastic/kibana/actions/runs/24511110075 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. 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 | |---|---| |  |  | **Deprecation hover tooltip** — hovering on a deprecated AI connector step shows the replacement suggestion:  **Autocomplete** — typing `inference` shows "No suggestions" (all `inference.*` steps are filtered):  **Add Action menu** — searching for "inference" or "bedrock" returns no options:  **`ai.prompt` not affected** — searching "ai" in the actions menu still shows AI Prompt, AI Classify, AI Summarize:  **Exact-match deprecation still works** — `kibana.createCase` still shows deprecation warning (existing behavior preserved):  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)
…r of ai.prompt (#263694) (#264354) # Backport This will backport the following commits from `main` to `9.4`: - [[One Workflow] Deprecate direct AI connector step types in favor of ai.prompt (#263694)](#263694) <!--- Backport version: 11.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Kirill Chernakov","email":"yakiryous@gmail.com"},"sourceCommit":{"committedDate":"2026-04-16T12:48:51Z","message":"[One Workflow] Deprecate direct AI connector step types in favor of ai.prompt (#263694)\n\n## Summary\n\nExtends the workflow step deprecation mechanism to support\n**prefix-based matching** and deprecates all direct AI connector step\ntypes (`inference.*`, `bedrock.*`, `gen-ai.*`, `gemini.*`) in favor of\nthe purpose-built `ai.prompt` step.\n\n- Users were confused by the availability of raw AI connector steps\nalongside the purpose-built `ai.*` steps ([Slack\nthread](https://elastic.slack.com/archives/C08U04SUN49/p1776097440515239))\n- Deprecated steps are hidden from autocomplete, the Add Action menu,\nand AI agent discovery\n- Existing workflows using these step types continue to work — they just\nshow a deprecation warning in the editor\n\n### Changes\n\n- Added `DEPRECATED_STEP_PREFIX_METADATA` to `@kbn/workflows` for\nprefix-based deprecation matching\n- Updated `getDeprecatedStepMetadata()` to check prefix matches after\nexact matches\n- Migrated all deprecation consumers from direct map access\n(`deprecatedMap[key]`) to function calls\n(`getDeprecatedStepMetadata(key)`)\n- Updated the agent builder tool to detect prefix deprecation on dynamic\nconnector steps\n\n### Screenshots\n\n**Editor deprecation warnings** — `inference.completion` and\n`bedrock.invokeAI` now show deprecation squiggles and hover tooltip:\n\n| Before (main) | After |\n|---|---|\n|\n\n|\n\n|\n\n**Deprecation hover tooltip** — hovering on a deprecated AI connector\nstep shows the replacement suggestion:\n\n\n\n**Autocomplete** — typing `inference` shows \"No suggestions\" (all\n`inference.*` steps are filtered):\n\n\n\n**Add Action menu** — searching for \"inference\" or \"bedrock\" returns no\noptions:\n\n\n\n**`ai.prompt` not affected** — searching \"ai\" in the actions menu still\nshows AI Prompt, AI Classify, AI Summarize:\n\n\n\n**Exact-match deprecation still works** — `kibana.createCase` still\nshows deprecation warning (existing behavior preserved):\n\n\n\nCloses elastic/security-team#16816\n\n## Test plan\n\n- [x] Verify `inference.*`, `bedrock.*`, `gen-ai.*`, `gemini.*` steps no\nlonger appear in autocomplete suggestions\n- [x] Verify these steps no longer appear in the Add Action menu\n- [x] Verify existing workflows using these steps show a deprecation\nwarning in the editor\n- [x] Verify `ai.prompt` step is not affected by the deprecation\n- [x] Verify `kibana.*` Cases steps still show exact-match deprecation\nwarnings\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>","sha":"9af9077847193ab7e10cef384a9aa099e9b1ce22","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:deprecation","backport missing","backport:version","Team:One Workflow","v9.4.0","v9.5.0"],"title":"[One Workflow] Deprecate direct AI connector step types in favor of ai.prompt","number":263694,"url":"https://github.com/elastic/kibana/pull/263694","mergeCommit":{"message":"[One Workflow] Deprecate direct AI connector step types in favor of ai.prompt (#263694)\n\n## Summary\n\nExtends the workflow step deprecation mechanism to support\n**prefix-based matching** and deprecates all direct AI connector step\ntypes (`inference.*`, `bedrock.*`, `gen-ai.*`, `gemini.*`) in favor of\nthe purpose-built `ai.prompt` step.\n\n- Users were confused by the availability of raw AI connector steps\nalongside the purpose-built `ai.*` steps ([Slack\nthread](https://elastic.slack.com/archives/C08U04SUN49/p1776097440515239))\n- Deprecated steps are hidden from autocomplete, the Add Action menu,\nand AI agent discovery\n- Existing workflows using these step types continue to work — they just\nshow a deprecation warning in the editor\n\n### Changes\n\n- Added `DEPRECATED_STEP_PREFIX_METADATA` to `@kbn/workflows` for\nprefix-based deprecation matching\n- Updated `getDeprecatedStepMetadata()` to check prefix matches after\nexact matches\n- Migrated all deprecation consumers from direct map access\n(`deprecatedMap[key]`) to function calls\n(`getDeprecatedStepMetadata(key)`)\n- Updated the agent builder tool to detect prefix deprecation on dynamic\nconnector steps\n\n### Screenshots\n\n**Editor deprecation warnings** — `inference.completion` and\n`bedrock.invokeAI` now show deprecation squiggles and hover tooltip:\n\n| Before (main) | After |\n|---|---|\n|\n\n|\n\n|\n\n**Deprecation hover tooltip** — hovering on a deprecated AI connector\nstep shows the replacement suggestion:\n\n\n\n**Autocomplete** — typing `inference` shows \"No suggestions\" (all\n`inference.*` steps are filtered):\n\n\n\n**Add Action menu** — searching for \"inference\" or \"bedrock\" returns no\noptions:\n\n\n\n**`ai.prompt` not affected** — searching \"ai\" in the actions menu still\nshows AI Prompt, AI Classify, AI Summarize:\n\n\n\n**Exact-match deprecation still works** — `kibana.createCase` still\nshows deprecation warning (existing behavior preserved):\n\n\n\nCloses elastic/security-team#16816\n\n## Test plan\n\n- [x] Verify `inference.*`, `bedrock.*`, `gen-ai.*`, `gemini.*` steps no\nlonger appear in autocomplete suggestions\n- [x] Verify these steps no longer appear in the Add Action menu\n- [x] Verify existing workflows using these steps show a deprecation\nwarning in the editor\n- [x] Verify `ai.prompt` step is not affected by the deprecation\n- [x] Verify `kibana.*` Cases steps still show exact-match deprecation\nwarnings\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>","sha":"9af9077847193ab7e10cef384a9aa099e9b1ce22"}},"sourceBranch":"main","suggestedTargetBranches":["9.4"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/263694","number":263694,"mergeCommit":{"message":"[One Workflow] Deprecate direct AI connector step types in favor of ai.prompt (#263694)\n\n## Summary\n\nExtends the workflow step deprecation mechanism to support\n**prefix-based matching** and deprecates all direct AI connector step\ntypes (`inference.*`, `bedrock.*`, `gen-ai.*`, `gemini.*`) in favor of\nthe purpose-built `ai.prompt` step.\n\n- Users were confused by the availability of raw AI connector steps\nalongside the purpose-built `ai.*` steps ([Slack\nthread](https://elastic.slack.com/archives/C08U04SUN49/p1776097440515239))\n- Deprecated steps are hidden from autocomplete, the Add Action menu,\nand AI agent discovery\n- Existing workflows using these step types continue to work — they just\nshow a deprecation warning in the editor\n\n### Changes\n\n- Added `DEPRECATED_STEP_PREFIX_METADATA` to `@kbn/workflows` for\nprefix-based deprecation matching\n- Updated `getDeprecatedStepMetadata()` to check prefix matches after\nexact matches\n- Migrated all deprecation consumers from direct map access\n(`deprecatedMap[key]`) to function calls\n(`getDeprecatedStepMetadata(key)`)\n- Updated the agent builder tool to detect prefix deprecation on dynamic\nconnector steps\n\n### Screenshots\n\n**Editor deprecation warnings** — `inference.completion` and\n`bedrock.invokeAI` now show deprecation squiggles and hover tooltip:\n\n| Before (main) | After |\n|---|---|\n|\n\n|\n\n|\n\n**Deprecation hover tooltip** — hovering on a deprecated AI connector\nstep shows the replacement suggestion:\n\n\n\n**Autocomplete** — typing `inference` shows \"No suggestions\" (all\n`inference.*` steps are filtered):\n\n\n\n**Add Action menu** — searching for \"inference\" or \"bedrock\" returns no\noptions:\n\n\n\n**`ai.prompt` not affected** — searching \"ai\" in the actions menu still\nshows AI Prompt, AI Classify, AI Summarize:\n\n\n\n**Exact-match deprecation still works** — `kibana.createCase` still\nshows deprecation warning (existing behavior preserved):\n\n\n\nCloses elastic/security-team#16816\n\n## Test plan\n\n- [x] Verify `inference.*`, `bedrock.*`, `gen-ai.*`, `gemini.*` steps no\nlonger appear in autocomplete suggestions\n- [x] Verify these steps no longer appear in the Add Action menu\n- [x] Verify existing workflows using these steps show a deprecation\nwarning in the editor\n- [x] Verify `ai.prompt` step is not affected by the deprecation\n- [x] Verify `kibana.*` Cases steps still show exact-match deprecation\nwarnings\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\n---------\n\nCo-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>","sha":"9af9077847193ab7e10cef384a9aa099e9b1ce22"}}]}] BACKPORT--> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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-builtai.promptstep.ai.*steps (Slack thread)Changes
DEPRECATED_STEP_PREFIX_METADATAto@kbn/workflowsfor prefix-based deprecation matchinggetDeprecatedStepMetadata()to check prefix matches after exact matchesdeprecatedMap[key]) to function calls (getDeprecatedStepMetadata(key))Screenshots
Editor deprecation warnings —
inference.completionandbedrock.invokeAInow show deprecation squiggles and hover tooltip:Deprecation hover tooltip — hovering on a deprecated AI connector step shows the replacement suggestion:
Autocomplete — typing
inferenceshows "No suggestions" (allinference.*steps are filtered):Add Action menu — searching for "inference" or "bedrock" returns no options:
ai.promptnot affected — searching "ai" in the actions menu still shows AI Prompt, AI Classify, AI Summarize:Exact-match deprecation still works —
kibana.createCasestill shows deprecation warning (existing behavior preserved):Closes elastic/security-team#16816
Test plan
inference.*,bedrock.*,gen-ai.*,gemini.*steps no longer appear in autocomplete suggestionsai.promptstep is not affected by the deprecationkibana.*Cases steps still show exact-match deprecation warnings🤖 Generated with Claude Code