Skip to content

Conversation

@ChrisMcKee1
Copy link

Enable manual triggering of workflows in DevUI by adding full JSON Schema type support, including Union types and None/null handling for workflows with optional or no inputs.

Key Feature - Manual Workflow Triggers

  • Workflows with no inputs (type: null) can now be triggered directly
  • Union types (X | None) properly detected via anyOf schema field
  • Optional inputs with defaults enable single-click execution
  • Smart run button adapts to input requirements automatically

Type System Enhancements

  • Support all primitive types: string, integer, number, boolean, array
  • Handle null type for input-free workflows
  • Detect optional types via anyOf and default: null patterns
  • Type-aware array inputs with item type labels (strings, integers, numbers)
  • Enhanced boolean fields with visual state indicators (true/false)
  • Dedicated integer/number handlers with proper step values and validation

UX Improvements

  • Smart run button logic auto-detects input requirements
  • Button text adapts: "Run Workflow" (no input) vs "Configure & Run" (has input)
  • Play icon for direct execution, Settings icon for configuration needed
  • Type-specific placeholders and validation feedback
  • Proper form initialization with type-appropriate defaults

Technical Implementation

  • Extended JSONSchema interfaces with null type and anyOf for Union support
  • Type guards distinguish primitive, object, and null inputs
  • Enhanced canSubmit validation handles all type combinations and optionality
  • Form validation properly treats None/null as valid for optional fields

Copilot AI review requested due to automatic review settings October 25, 2025 04:41
@github-actions github-actions bot changed the title feat(devui): enable manual workflow triggers with comprehensive type support Python: feat(devui): enable manual workflow triggers with comprehensive type support Oct 25, 2025
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Oct 25, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL12297200883% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python Unit Test Overview

Tests Skipped Failures Errors Time
1408 98 💤 0 ❌ 0 🔥 28.106s ⏱️

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables manual workflow triggering in DevUI with comprehensive type support for workflow inputs. The main enhancement is adding support for workflows with no inputs (type: null) and Union types (e.g., str | None), allowing both input-free workflows and optional parameters to be executed seamlessly.

Key changes:

  • Added JSON Schema support for null type and Union types via anyOf field
  • Extended workflow input handling for primitive types (integer, number, boolean, array)
  • Enhanced UX with smart run button logic that adapts based on input requirements

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
python/packages/devui/frontend/src/types/index.ts Added null type and anyOf field to JSONSchema interfaces for Union type support
python/packages/devui/frontend/src/components/features/workflow/workflow-view.tsx Enhanced run button logic to detect null types and distinguish between configuration-needed vs direct-run workflows
python/packages/devui/frontend/src/components/features/workflow/workflow-input-form.tsx Added handlers for integer, number, boolean, and array types with improved validation and UX
python/packages/devui/agent_framework_devui/_utils.py Extended schema generation to handle None types, Union types, and list types with proper optional marking
python/packages/devui/agent_framework_devui/ui/assets/index-CE4pGoXh.css Removed compiled CSS file (should be generated during build)
python/packages/devui/.gitignore Added exclusion for generated frontend build artifacts

"""
# 1. Built-in types
# Handle None type (no input required)
if input_type is type(None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks,
Should we consider adding a decent but minimal test for test for non_type ? probably in ``test_schema_generation.py

Copy link
Author

Choose a reason for hiding this comment

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

Done! Added test_none_type_schema_generation() and test_optional_type_schema_generation() in test_schema_generation.py. Both tests pass.

.DS_Store
Thumbs.db

# Frontend build artifacts (generated by npm run build)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is actually intentional.
UI builds are bundled with the devui source. This is what gets served by the backend app, simplifies usage.
Currently the build size is carefully maintained < 800kb.

When edits are complete, run yarn build and commit the updated build bundle.

Copy link
Author

Choose a reason for hiding this comment

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

Reverted. UI builds are now committed and will be bundled with the package.

@ChrisMcKee1
Copy link
Author

ChrisMcKee1 commented Oct 27, 2025

Thanks for the feedback and mentorship, Victor! We've addressed all your review comments:

1. Variable shadowing fixed: Renamed second origin to list_origin in Union vs list type checks for better clarity.

2. .gitignore reverted: UI builds are now correctly bundled with source as intended.

3. Frontend built: Ran
npm run build and committed the bundle (726.91 kB, within <800kb requirement).

4. Tests added: Added test_none_type_schema_generation() and est_optional_type_schema_generation() to verify None type and Union type handling.

@markwallace-microsoft markwallace-microsoft added the lab Agent Framework Lab label Oct 27, 2025
…support

Enable manual triggering of workflows in DevUI by adding full JSON Schema type support,
including Union types and None/null handling for workflows with optional or no inputs.

Key Feature - Manual Workflow Triggers:
- Workflows with no inputs (type: null) can now be triggered directly
- Union types (X | None) properly detected via anyOf schema field
- Optional inputs with defaults enable single-click execution
- Smart run button adapts to input requirements automatically

Type System Enhancements:
- Support all primitive types: string, integer, number, boolean, array
- Handle null type for input-free workflows
- Detect optional types via anyOf and default: null patterns
- Type-aware array inputs with item type labels (strings, integers, numbers)
- Enhanced boolean fields with visual state indicators (true/false)
- Dedicated integer/number handlers with proper step values and validation

UX Improvements:
- Smart run button logic auto-detects input requirements
- Button text adapts: "Run Workflow" (no input) vs "Configure & Run" (has input)
- Play icon for direct execution, Settings icon for configuration needed
- Type-specific placeholders and validation feedback
- Proper form initialization with type-appropriate defaults

Technical Implementation:
- Extended JSONSchema interfaces with null type and anyOf for Union support
- Type guards distinguish primitive, object, and null inputs
- Enhanced canSubmit validation handles all type combinations and optionality
- Form validation properly treats None/null as valid for optional fields
- tomli: 2.2.1 -> 2.3.0
- uv: 0.8.23 -> 0.8.24
- virtualenv: 20.34.0 -> 20.35.3
- yarl: 1.21.0 -> 1.22.0
- Remove trailing whitespace
- Normalize quote style to double quotes
- Replace elif with if for clearer control flow
- Use direct attribute access for types.UnionType
- Fix variable shadowing: rename 'origin' to 'list_origin' for list type checks
- Revert .gitignore changes: UI builds are intentionally bundled with source
- Build and commit frontend bundle (726.91 kB, within <800kb requirement)
- Bundle includes updated workflow input form and view components
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lab Agent Framework Lab python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants