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.
Custom Workflow Step Registration - PoC
Summary
This PR introduces a step registry mechanism that allows Kibana plugins to register custom workflow step types without modifying the core workflow engine. This is a proof of concept to validate the extensibility approach.
Motivation
The workflow engine currently has a fixed set of built-in step types (HTTP, Elasticsearch, Kibana, etc.). Teams need the ability to create domain-specific step types (e.g., enrichment steps, custom actions, ML inference) without requiring changes to the core engine.
Changes
Core Engine (
workflows_execution_engine)New Components:
StepTypeRegistry: Registry class for managing custom step typesCustomStepImpl: Execution handler for registered stepsregisterStepType(): Public API in plugin setup contractStep Type Definition:
Handler Context:
Custom step handlers receive:
inputSchemasetStepState()/getStepState()UI/Validation (
workflows_management)Schema Updates:
.passthrough()to step schemas to allow dynamic state propertiesgetSchemaAtPath()to recognize passthrough objectsHover Documentation:
RegisteredStepMonacoHandlerfor custom step tooltipsExample Plugin (
workflows_step_example)Created a proof-of-concept plugin demonstrating registration of a
setvarstep type:Registration (plugin setup):
Usage in workflows:
Technical Approach
Encapsulated State Management
Custom steps persist data using
context.contextManager.setStepState(). The state is automatically spread into the step context, making it accessible to subsequent steps via{{ steps.stepName.property }}. This approach requires no changes to the core context management system.Priority-Based Handler Resolution
The hover provider uses a priority system:
This ensures registered steps get appropriate documentation instead of generic connector hints.
Schema Validation Flow
Files Changed
Core:
src/platform/plugins/shared/workflows_execution_engine/server/step_type_registry.ts(new)src/platform/plugins/shared/workflows_execution_engine/server/step/custom_step_impl.ts(new)src/platform/plugins/shared/workflows_execution_engine/server/plugin.ts(modified)src/platform/plugins/shared/workflows_execution_engine/server/types.ts(modified)Types:
src/platform/packages/shared/kbn-workflows/common/step_registry_types.ts(new)UI/Validation:
src/platform/plugins/shared/workflows_management/public/widgets/workflow_yaml_editor/lib/monaco_connectors/registered_step_monaco_handler.ts(new)src/platform/plugins/shared/workflows_management/public/features/workflow_context/lib/get_steps_collection_schema.ts(modified)src/platform/plugins/shared/workflows_management/common/lib/zod/zod_utils.ts(modified)Example:
examples/workflows_step_example/(new)Testing
Manual testing performed:
TODO for production:
StepTypeRegistryBreaking Changes
None. This is an additive change that introduces new APIs without modifying existing behavior.
Next Steps
If this approach is validated, next steps would include: