Skip to content

Python: feat(devui): enable manual workflow triggers with comprehensive type support - Replat on main#4273

Open
alliscode wants to merge 1 commit intomicrosoft:mainfrom
alliscode:devui-manual-trigger
Open

Python: feat(devui): enable manual workflow triggers with comprehensive type support - Replat on main#4273
alliscode wants to merge 1 commit intomicrosoft:mainfrom
alliscode:devui-manual-trigger

Conversation

@alliscode
Copy link
Member

This PR replaces the out-of-date PR here: #1693. The old PR has been re-implemented on the current main after many breaking changes for RC/GA.

Original PR description:

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 February 25, 2026 19:52
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 triggers in the DevUI by adding comprehensive JSON Schema type support for various primitive types (null, integer, number, boolean, array) in addition to the existing string and object types. The changes span both the Python backend (schema generation and input parsing) and the TypeScript/React frontend (UI rendering and form validation).

Changes:

  • Added None/null type support for workflows with no inputs, allowing direct execution
  • Implemented Union/Optional type handling (X | None) in schema generation with default: None
  • Extended primitive type support to integer, number, boolean, and array types with dedicated UI components
  • Enhanced form validation and submission logic to handle all new input types

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
python/packages/devui/agent_framework_devui/_utils.py Extended generate_input_schema to handle None type, Union types (X | None), and list/array types; added Union handling in parse_input_for_type and _parse_dict_input
python/packages/devui/tests/devui/test_schema_generation.py Added tests for None type and Optional type schema generation (str | None, int | None)
python/packages/devui/frontend/src/types/index.ts Made type field optional and added "null" to type union; added anyOf field for Union type support
python/packages/devui/frontend/src/components/features/workflow/workflow-input-form.tsx Added dedicated renderers for integer, number, boolean, and array inputs; extended validation and submission logic; added null type handling
python/packages/devui/frontend/src/components/features/workflow/run-workflow-button.tsx Extended input analysis to detect null, integer, number, boolean, and array types; updated default data building and UI labels for new types
Comments suppressed due to low confidence (1)

python/packages/devui/agent_framework_devui/_utils.py:462

  • The inline comments have duplicate numbering: both Pydantic models (line 450) and SerializationMixin classes (line 454) are labeled as "3". The subsequent sections should be renumbered to maintain consistent sequential numbering:
  • Line 439: "2. Generic types" ✓
  • Line 450: "3. Pydantic models" ✓
  • Line 454: Should be "4. SerializationMixin classes"
  • Line 458: Should be "5. Dataclasses"
  • Line 462: Should be "6. Fallback to string"
    # 3. Pydantic models (legacy support)
    if hasattr(input_type, "model_json_schema"):
        return input_type.model_json_schema()  # type: ignore

    # 3. SerializationMixin classes (Message, etc.)
    if is_serialization_mixin(input_type):
        return generate_schema_from_serialization_mixin(input_type)

    # 4. Dataclasses
    if is_dataclass(input_type):
        return generate_schema_from_dataclass(input_type)

    # 5. Fallback to string

@alliscode alliscode force-pushed the devui-manual-trigger branch 6 times, most recently from b47741d to 6d9bb4d Compare February 25, 2026 21:08
@markwallace-microsoft
Copy link
Member

Python Test Coverage

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

Python Unit Test Overview

Tests Skipped Failures Errors Time
4667 247 💤 0 ❌ 0 🔥 1m 21s ⏱️

…ve type 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 changes:
- generate_input_schema: support None type, Union/Optional, generic list types
- parse_input_for_type: handle None type, guard isinstance for special types
- _parse_dict_input: handle Union types by extracting non-None base type
- JSONSchema TypeScript interface: add null type, anyOf, make type optional
- RunWorkflowButton: handle null/integer/number/boolean/array in analysis,
  defaults, icons, and type labels
- WorkflowInputForm: add canSubmit/submit/init/renderers for all primitive
  types at top-level schema
- Tests: add test_none_type_schema_generation, test_optional_type_schema_generation

Reimplements microsoft#1693 onto current main after significant codebase refactoring.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@alliscode alliscode force-pushed the devui-manual-trigger branch from 6d9bb4d to 63fa9de Compare February 25, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants