-
Couldn't load subscription status.
- Fork 621
Python: feat(devui): enable manual workflow triggers with comprehensive type support #1693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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): |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
python/packages/devui/.gitignore
Outdated
| .DS_Store | ||
| Thumbs.db | ||
|
|
||
| # Frontend build artifacts (generated by npm run build) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
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 4. Tests added: Added test_none_type_schema_generation() and est_optional_type_schema_generation() to verify None type and Union type handling. |
392a1f5 to
1378458
Compare
…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
1378458 to
9fee459
Compare
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
Type System Enhancements
UX Improvements
Technical Implementation