Skip to content

Conversation

@h88
Copy link
Contributor

@h88 h88 commented Nov 18, 2025

TBD

h88 added 9 commits November 17, 2025 17:31
… enable

advanced validation features including:
- Email, URI, and date-time format validation
- Regex pattern validation for IP addresses, CVE IDs, etc.
- Nested object structures with deep validation
- Array constraints (minItems, maxItems, uniqueItems)
- Number and string constraints (min/max, minLength/maxLength)
- Additional properties control
- Schema references and composition

Changes:
- Update WorkflowSchema to use WorkflowInputsJsonSchema (properties, required, additionalProperties)
- Add normalizeInputsToJsonSchema() for backward compatibility with legacy array format
- Enable format validation in JSON Schema validator (email, uri, date-time)
- Update all input processing code to handle new JSON Schema structure
- Convert JSON Schema to Zod schemas for runtime validation
- Add comprehensive tests for JSON Schema features and backward compatibility

Backward Compatibility:
- Legacy array-based inputs are automatically converted to JSON Schema format
- WorkflowSchemaForAutocomplete accepts both formats during parsing
- All existing workflows continue to work without modification
…by ensuring the version field is removed from the required array inside allOf items (similar to the version fix).

Legacy array inputs support: Fixed the "Expected '0'" error by ensuring allOf[1].inputs (from the .pipe() transformation) accepts both array and object formats. The issue was that allOf[1].inputs was a $ref pointing only to the object schema, so arrays failed validation. Now it's wrapped in an anyOf that includes both formats.
@h88 h88 self-assigned this Nov 18, 2025
@h88 h88 added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting beta Required for a feature to move to beta Team:One Workflow Team label for One Workflow (Workflow automation) labels Nov 18, 2025
@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 18, 2025

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!

h88 added 3 commits November 18, 2025 18:02
…ntext

  - Type field: suggests JSON Schema types (string, number, boolean, object, array, null)
  - Format field: suggests format values (email, uri, date-time, uuid, etc.)
  - Enum values: suggests enum values from schema definitions
  - Property keys: suggests JSON Schema property keywords (type, format, enum, etc.)

Suppress Ajv console errors during JSON Schema validation
  - Prevents noisy console errors from Ajv compilation of large/complex schemas
  - Errors are expected and don't affect functionality

Add utility functions for inputs.properties context detection
  - isInInputsPropertiesContext: detects if cursor is in inputs.properties
  - getInputPropertyName: extracts property name from YAML path
@elasticmachine
Copy link
Contributor

💔 Build Failed

Failed CI Steps

cc @h88

h88 added 3 commits November 19, 2025 16:20
in workflow inputs and fixes several issues related to default value
application and backward compatibility.

Key changes:
- Add support for `definitions` and `$defs` in WorkflowInputsJsonSchema
- Implement $ref resolution in applyInputDefaults to resolve references
  and apply defaults from referenced schemas
- Fix validation to accept $ref objects without trying to compile them
  in isolation
- Restore ensureVersionIsOptional function to make version field optional
  in Monaco schema (prevents "Missing property 'version'" errors)
- Add fixInputsSchemaForMonaco to support both legacy array and new
  object formats for backward compatibility
- Fix workflow execute modal to extract inputs from yamlString when
  definition.inputs is undefined (fixes modal not opening for new format)
- Update getZodTypeName to handle ZodEnum types correctly
- Add comprehensive test coverage for $ref resolution and default values

Fixes:
- Default values from $ref references are now correctly applied
- Version field is optional in Monaco editor validation
- Legacy array inputs format works correctly with new schema
- Inputs modal opens correctly for workflows with JSON Schema inputs
properties were not being pre-filled in the manual execution modal,
causing the input editor to show empty object '{}' instead of defaults.

Key changes:
- Add hasDefaultsRecursive function to detect defaults at any nesting level
- Update createObjectWithDefaults to include properties with nested defaults
- Update applyInputDefaults to return undefined when no defaults applied
- Fix getDefaultWorkflowInput to use applyInputDefaults for consistency
- Update useEffect to handle '{}' case and pre-fill defaults
- Add comprehensive test for Threat Intelligence Enrichment workflow
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 beta Required for a feature to move to beta release_note:skip Skip the PR/issue when compiling release notes Team:One Workflow Team label for One Workflow (Workflow automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants