[One Workflow] feat: Type inference for ai.prompt step output from output schema#246504
Merged
skynetigor merged 83 commits intoelastic:mainfrom Feb 4, 2026
Conversation
… and update related schema retrieval functions
…roved clarity and maintainability
…ut-from-outputSchema
…putSchema' of https://github.com/skynetigor/kibana into 15061-Type-inference-for-ai.prompt-step-output-from-outputSchema
… adjust output response handling in aiPromptStepDefinition
skynetigor
commented
Dec 18, 2025
src/platform/plugins/shared/workflows_extensions/public/steps/ai/temp.ts
Outdated
Show resolved
Hide resolved
skynetigor
commented
Dec 19, 2025
src/platform/plugins/shared/workflows_extensions/common/steps/ai/ai_prompt_step.ts
Outdated
Show resolved
Hide resolved
skynetigor
commented
Dec 19, 2025
…ut-from-outputSchema
….prompt-step-output-from-outputSchema
Contributor
Author
|
@elasticmachine merge upstream |
…ut-from-outputSchema
semd
reviewed
Feb 2, 2026
src/platform/plugins/shared/workflows_extensions/public/steps/ai/ai_prompt_step.ts
Outdated
Show resolved
Hide resolved
…tep-output-from-outputSchema
jbudz
approved these changes
Feb 3, 2026
…for improved type safety
…ut-from-outputSchema
Contributor
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes: https://github.com/elastic/security-team/issues/15061
Screen.Recording.2026-01-21.at.13.24.00.mov
Summary
Add type inference support for the AI prompt step, enabling dynamic output schema validation based on user-defined JSON Schema. This change allows workflows to leverage strongly-typed outputs from AI prompts when an
outputSchemais provided, improving type safety and developer experience in workflow definitions. The implementation includes schema validation, dynamic type inference for both string and structured outputs, and enhanced connector ID autocomplete for AI steps.New Features
ai.promptstep outputs based on user-provided JSON Schema, allowing strongly-typed workflow variables downstreamsystemPromptfield toai.promptstep input schema for better control over AI model behaviortitleanddescriptionfields toJsonModelSchemafor richer workflow input documentationgen-ai.run) for AI workflow stepsKey Capabilities
schemais provided in theai.promptstep, the output type is automatically inferred, enabling IDE autocomplete and validation for workflow variablesgetStructuredOutputSchema()helper to wrap custom schemas with metadata, providing consistent output structure across all AI steps