Skip to content

[Search] Move ai.prompt, ai.summarize, ai.classify workflows to inference plugin#269392

Merged
yansavitski merged 34 commits into
elastic:mainfrom
yansavitski:feature/move-ai-workflows-to-inference
May 29, 2026
Merged

[Search] Move ai.prompt, ai.summarize, ai.classify workflows to inference plugin#269392
yansavitski merged 34 commits into
elastic:mainfrom
yansavitski:feature/move-ai-workflows-to-inference

Conversation

@yansavitski
Copy link
Copy Markdown
Contributor

@yansavitski yansavitski commented May 14, 2026

Summary

Resolves https://github.com/elastic/search-team/issues/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, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests 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
  • 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 was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Test plan

  • 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

…enceWorkflows plugin

Create a new `inferenceWorkflows` plugin at x-pack/platform/plugins/shared/inference_workflows/
that registers the three AI workflow steps via the external workflowsExtensions registration API.

This moves inference-specific workflow step logic out of the generic workflows_extensions plugin
and into a search-team owned plugin, following the same pattern as agent_builder.
Remove ai.prompt, ai.summarize, ai.classify step definitions from the
workflows_extensions plugin now that they are registered externally by
the new inferenceWorkflows plugin. Update CODEOWNERS and i18n config.
@yansavitski yansavitski requested review from a team as code owners May 14, 2026 22:11
@botelastic botelastic Bot added the Team:One Workflow Team label for One Workflow (Workflow automation) label May 14, 2026
@yansavitski yansavitski changed the title Move ai.prompt, ai.summarize, ai.classify workflows to inference plugin [Search][WIP] Move ai.prompt, ai.summarize, ai.classify workflows to inference plugin May 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

@github-actions
Copy link
Copy Markdown
Contributor

✅ Vale Linting Results

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide.

To use Vale locally or report issues, refer to Elastic style guide for Vale.

@yansavitski yansavitski added release_note:enhancement backport:skip This PR does not require backporting Team:Search ci:project-deploy-elasticsearch Create an Elasticsearch Serverless project labels May 15, 2026
@saikatsarkar056
Copy link
Copy Markdown
Contributor

register_inference_features.ts was moved to the new plugin but never actually called in setup(). Without this, the model picker won't show up in the Inference Endpoints settings page for any of the three steps. The working pattern is already in workflows_extensions/server/plugin.ts, which calls registerInferenceFeatures(plugins.searchInferenceEndpoints). The new plugin needs to do the same.

We can manually test this by going the Feature Settings page.

yansavitski and others added 3 commits May 20, 2026 13:12
…e deps from workflows_extensions

- Move searchInferenceEndpoints optional dep from workflows_extensions to inference_workflows
- Call registerInferenceFeatures in inference_workflows plugin setup
- Fix SSPL license headers on ai_feature_ids.ts and register_inference_features.ts (x-pack requires EL2.0)
- Add InferenceWorkflowsSetupDeps/StartDeps types with searchInferenceEndpoints
…ansavitski/kibana into feature/move-ai-workflows-to-inference
@yansavitski
Copy link
Copy Markdown
Contributor Author

@saikatsarkar056 Yeah I fixed that locally but didn't create a commit yet. Locally everything works now

@yansavitski yansavitski requested a review from a team as a code owner May 20, 2026 14:04
...AiClassifyStepCommonDefinition,
icon: React.lazy(() =>
import('@elastic/eui/es/components/icon/assets/product_agent').then(({ icon }) => ({
import('@elastic/eui/src/components/icon/assets/product_agent').then(({ icon }) => ({
Copy link
Copy Markdown
Contributor

@saikatsarkar056 saikatsarkar056 May 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elastic/eui/src/... is different from what every other workflow step plugin uses (/es/). Change to @elastic/eui/es/components/icon/assets/product_agent (same for ai_summarize and ai_classify). You'll also need a public/eui_icons.d.ts.

See agent_builder/public/eui_icons.d.ts for the module declaration.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

Add public/eui_icons.d.ts (matching agent_builder pattern) and revert
icon imports from src/ back to es/ path.
Replace template literals with variable substitution in defaultMessage
with i18n values object pattern as required by the i18n linter.
defaultMessage: 'Categorizes data into predefined categories using AI',
}),
documentation: {
details: i18n.translate('workflowsExtensionsExample.AiClassifyStep.documentation.details', {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: the template literal substitution in defaultMessage here (\The ${AiClassifyStepTypeId} step...) is not valid i18n syntax — the i18n extraction tool requires static strings with variables passed via the values object instead.
This went unnoticed because the workflowsExtensionsExample namespace wasn't registered in .i18nrc.json

@yansavitski yansavitski enabled auto-merge (squash) May 21, 2026 12:56
@saikatsarkar056
Copy link
Copy Markdown
Contributor

I tested this change locally. The Feature Settings page displays the Workflow ai sub-features properly.

Screenshot 2026-05-21 at 3 31 07 PM

@yansavitski
Copy link
Copy Markdown
Contributor Author

@elastic/workflows-eng, @elastic/kibana-core could you review this pr?

@yansavitski yansavitski changed the title [Search][WIP] Move ai.prompt, ai.summarize, ai.classify workflows to inference plugin [Search] Move ai.prompt, ai.summarize, ai.classify workflows to inference plugin May 22, 2026
@jloleysens jloleysens removed the request for review from a team May 22, 2026 14:10
@yansavitski yansavitski removed ci:project-deploy-elasticsearch Create an Elasticsearch Serverless project Team:One Workflow Team label for One Workflow (Workflow automation) labels May 26, 2026
@botelastic botelastic Bot added the Team:One Workflow Team label for One Workflow (Workflow automation) label May 26, 2026
Copy link
Copy Markdown
Contributor

@skynetigor skynetigor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kibanamachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #139 / lens app - TSVB Open in Lens Convert to Lens action on dashboard "before all" hook for "should show notification in context menu if visualization can be converted"
  • [job] [logs] Scout Lane #14 - stateful-classic / default / local-stateful-classic - Create Data View wizard - data stream is accepted as an index pattern source and wizard auto-detects the timestamp field
  • [job] [logs] Scout Lane #2 - stateful-classic / default / local-stateful-classic - Query streams - Edit query stream - should support editing an existing query stream's ES|QL query from the partitioning tab
  • [job] [logs] FTR Configs #30 / Profiling API tests functions.spec.ts cloud Loading profiling data Functions api With data "before all" hook for "returns correct result"

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
inferenceWorkflows - 199 +199
workflowsExtensions 240 232 -8
total +191

Async chunks

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

id before after diff
inferenceWorkflows - 19.0KB +19.0KB
workflowsExtensions 53.0KB 14.0KB -39.0KB
total -20.0KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
inferenceWorkflows - 4.0KB +4.0KB
workflowsExtensions 40.2KB 39.9KB -328.0B
total +3.7KB
Unknown metric groups

async chunk count

id before after diff
inferenceWorkflows - 5 +5
workflowsExtensions 23 19 -4
total +1

History

@yansavitski yansavitski merged commit 209d0b6 into elastic:main May 29, 2026
33 checks passed
@yansavitski yansavitski deleted the feature/move-ai-workflows-to-inference branch May 29, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:enhancement Team:One Workflow Team label for One Workflow (Workflow automation) Team:Search v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants