Skip to content

Support HIL workflows when exposed via WorkflowAgent in DevUI agent mode #2924

@rafaelolsr

Description

@rafaelolsr

When using a workflow with Human-in-the-Loop (HIL) via ctx.request_info() and wrapping it with .as_agent() for DevUI, the HIL response validation fails with:

Response type mismatch for request ID ...: expected <class 'ApprovalResponse'>, got <class 'dict'>

Root Cause

  • Graph mode (_execute_workflow in agent_framework_devui/_executor.py): Calls parse_input_for_type() at line 454 to convert dict → dataclass before send_responses_streaming()
  • Agent mode (_execute_agent): Has no HIL handling - passes raw dicts directly to agent.run_stream(), which eventually hits validation at _workflow.py:703

Expected Behavior

WorkflowAgent wrapped workflows should work with HIL in DevUI the same way direct workflow execution does.

Suggested Fix

In _execute_agent(), detect when the agent is a WorkflowAgent and apply the same type conversion logic used in _execute_workflow().

Workaround

Use graph mode only (pass workflow directly to serve() without .as_agent())

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions