Skip to content

Commit b8cfa45

Browse files
yansavitskikibanamachine
authored andcommitted
[Search][WIP] Move ai.prompt, ai.summarize, ai.classify workflows to inference plugin (elastic#269392)
## Summary Resolves elastic/search-team#14019 Moves the three AI workflow steps (`ai.prompt`, `ai.summarize`, `ai.classify`) from the `workflowsExtensions` plugin to a new `inferenceWorkflows` plugin owned by `@elastic/search-kibana`. - Created new `inferenceWorkflows` plugin at `x-pack/platform/plugins/shared/inference_workflows/` - Steps are registered via the external `workflowsExtensions.registerStepDefinition()` API (same pattern as `agent_builder`) - Registers workflows AI features with `searchInferenceEndpoints` so admins can configure model restrictions per step on the Inference Endpoints settings page - Removed AI step code from `workflows_extensions` — it now only contains data.* steps - Updated CODEOWNERS, i18n config, optimizer limits, and README ### Why a new plugin? The `inference` plugin cannot depend on `workflowsExtensions` (circular dependency — `workflowsExtensions` already depends on `inference`). A dedicated plugin keeps dependencies flowing in the right direction and gives the search team clear ownership. ### What changed | Area | Before | After | |------|--------|-------| | AI step registration | Internal in `workflowsExtensions` | External via `inferenceWorkflows` plugin | | License | SSPL triple-license (`src/`) | Elastic License 2.0 (`x-pack/`) | | i18n prefix | `workflowsExtensionsExample.*` | `xpack.inferenceWorkflows.*` | | Inference feature registration | `workflowsExtensions` (stale after merge) | `inferenceWorkflows` plugin setup | | Step logic | **Unchanged** | **Unchanged** | ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [x] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ## Test plan - [x] 160 unit tests pass in the new location - [ ] Verify AI steps appear in the workflow editor UI - [ ] Verify connector-id selection works for all three steps - [ ] Verify AI steps appear under Workflows AI on the Inference Endpoints settings page - [ ] Verify in serverless mode - [ ] Update `approved_step_definitions.ts` handler hashes after CI build 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
1 parent d9f99cd commit b8cfa45

54 files changed

Lines changed: 413 additions & 344 deletions

Some content is hidden

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

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,7 @@ x-pack/platform/plugins/shared/inbox @elastic/security-genai-research-and-develo
11901190
x-pack/platform/plugins/shared/index_management @elastic/kibana-management
11911191
x-pack/platform/plugins/shared/inference @elastic/search-kibana
11921192
x-pack/platform/plugins/shared/inference_endpoint @elastic/search-kibana
1193+
x-pack/platform/plugins/shared/inference_workflows @elastic/search-kibana
11931194
x-pack/platform/plugins/shared/ingest_hub @elastic/obs-onboarding-team
11941195
x-pack/platform/plugins/shared/ingest_pipelines @elastic/kibana-management
11951196
x-pack/platform/plugins/shared/lens @elastic/kibana-visualizations

docs/extend/plugin-list.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ mapped_pages:
173173
| [indicesMetadata](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/private/indices_metadata/README.md) | Plugin for managing and retrieving metadata about indices in Kibana. This plugin collects and processes metadata from Elasticsearch indices, data streams, ILM policies, and index templates. |
174174
| [inference](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/inference/README.md) | The inference plugin is a central place to handle all interactions with the Elasticsearch Inference API and external LLM APIs. Its goals are: |
175175
| [inferenceEndpoint](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/inference_endpoint/README.md) | A Kibana plugin |
176+
| [inferenceWorkflows](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/inference_workflows/README.md) | Registers AI workflow steps (ai.prompt, ai.summarize, ai.classify) that use the inference plugin to power LLM-based automation in Kibana Workflows. |
176177
| [infra](https://github.com/elastic/kibana/blob/main/x-pack/solutions/observability/plugins/infra/README.md) | This is the home of the infra plugin, which aims to provide a solution for the infrastructure monitoring use-case within Kibana. |
177178
| [ingestHub](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/ingest_hub/README.md) | Cross-solution onboarding page for adding data sources and integrations. Gated behind the ingestHub.enabled feature flag. |
178179
| [ingestPipelines](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/ingest_pipelines/README.md) | The ingest_pipelines plugin provides Kibana support for Elasticsearch's ingest pipelines. |

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,7 @@
762762
"@kbn/inference-prompt-utils": "link:x-pack/platform/packages/shared/kbn-inference-prompt-utils",
763763
"@kbn/inference-tracing": "link:x-pack/platform/packages/shared/kbn-inference-tracing",
764764
"@kbn/inference-tracing-config": "link:x-pack/platform/packages/shared/kbn-inference-tracing-config",
765+
"@kbn/inference-workflows-plugin": "link:x-pack/platform/plugins/shared/inference_workflows",
765766
"@kbn/infra-forge": "link:x-pack/platform/packages/private/kbn-infra-forge",
766767
"@kbn/infra-plugin": "link:x-pack/solutions/observability/plugins/infra",
767768
"@kbn/ingest-hub-plugin": "link:x-pack/platform/plugins/shared/ingest_hub",

packages/kbn-optimizer/limits.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ pageLoadAssetSize:
9191
indexLifecycleManagement: 47110
9292
indexManagement: 39694
9393
inference: 10368
94+
inferenceWorkflows: 25000
9495
infra: 56302
9596
ingestHub: 13422
9697
ingestPipelines: 17866

packages/kbn-rspack-optimizer/limits.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ pageLoadAssetSize:
9090
inbox: 1294
9191
indexLifecycleManagement: 39553
9292
indexManagement: 316
93-
inference: 5564
93+
inference: 5751
94+
inferenceWorkflows: 25000
9495
infra: 45673
9596
ingestHub: 1923
9697
ingestPipelines: 270

src/platform/plugins/shared/workflows_extensions/common/steps/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
export * from './ai';
1110
export * from './data';

src/platform/plugins/shared/workflows_extensions/kibana.jsonc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
"browser": true,
1212
"server": true,
1313
"requiredPlugins": ["actions", "inference", "spaces"],
14-
"optionalPlugins": ["searchInferenceEndpoints"],
1514
"extraPublicDirs": ["common"]
1615
}
1716
}
18-

src/platform/plugins/shared/workflows_extensions/moon.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ dependsOn:
2525
- '@kbn/scout'
2626
- '@kbn/i18n'
2727
- '@kbn/inference-plugin'
28-
- '@kbn/inference-common'
2928
- '@kbn/actions-plugin'
3029
- '@kbn/utility-types'
3130
- '@kbn/spaces-plugin'
@@ -35,7 +34,6 @@ dependsOn:
3534
- '@kbn/logging-mocks'
3635
- '@kbn/logging'
3736
- '@kbn/core-http-common'
38-
- '@kbn/search-inference-endpoints'
3937
tags:
4038
- plugin
4139
- prod

src/platform/plugins/shared/workflows_extensions/public/steps/index.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ export const registerInternalStepDefinitions = (stepRegistry: PublicStepRegistry
2929
stepRegistry.register(() =>
3030
import('./data/data_aggregate_step').then((m) => m.dataAggregateStepDefinition)
3131
);
32-
stepRegistry.register(() => import('./ai/ai_prompt_step').then((m) => m.AiPromptStepDefinition));
33-
stepRegistry.register(() =>
34-
import('./ai/ai_summarize_step').then((m) => m.AiSummarizeStepDefinition)
35-
);
36-
stepRegistry.register(() =>
37-
import('./ai/ai_classify_step').then((m) => m.AiClassifyStepDefinition)
38-
);
3932
stepRegistry.register(() =>
4033
import('./data/data_stringify_json_step').then((m) => m.dataStringifyJsonStepDefinition)
4134
);

src/platform/plugins/shared/workflows_extensions/server/plugin.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import { registerGetStepDefinitionsRoute } from './routes/get_step_definitions';
2525
import { registerGetTriggerDefinitionsRoute } from './routes/get_trigger_definitions';
2626
import { ServerStepRegistry } from './step_registry';
2727
import { registerInternalStepDefinitions } from './steps';
28-
import { registerInferenceFeatures } from './steps/ai/register_inference_features';
2928
import { TriggerRegistry } from './trigger_registry';
3029
import { registerInternalTriggerDefinitions } from './triggers';
3130
import type {
@@ -78,13 +77,9 @@ export class WorkflowsExtensionsServerPlugin
7877
registerGetStepDefinitionsRoute(router, this.stepRegistry);
7978
registerGetTriggerDefinitionsRoute(router, this.triggerRegistry);
8079

81-
registerInternalStepDefinitions(core, this.stepRegistry);
80+
registerInternalStepDefinitions(this.stepRegistry);
8281
registerInternalTriggerDefinitions(this.triggerRegistry);
8382

84-
if (plugins.searchInferenceEndpoints) {
85-
registerInferenceFeatures(plugins.searchInferenceEndpoints);
86-
}
87-
8883
return {
8984
registerStepDefinition: (definition) => {
9085
this.stepRegistry.register(definition);

0 commit comments

Comments
 (0)