Skip to content

.NET Workflows - Support Question for declarative workflow code generation #2802

Description

@crickman

Code generation for Question requires implemention

Activity

  1. changed the title [-].NET Workflows - Support Question for declarative workflow code generation[/-] [+].NET Workflows - Support `Question` for declarative workflow code generation[/+] on Dec 11, 2025
  2. added
    epicUsage: [Issues], Target: milestone planning
    and removed
    epicUsage: [Issues], Target: milestone planning
    on Dec 16, 2025
  3. removed their assignment
    on Feb 12, 2026
  4. baywet commented on Aug 26, 2026

    @baywet
    Member

    Additional context for anyone picking this up:

    In this area, Question refers to the declarative workflow human-input action, not a generic Q&A feature. The declarative workflow README lists it under Human Input as an action that presents a prompt requiring human input.

    Runtime support already exists in the interpreter path:

    • dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\ObjectModel\QuestionExecutor.cs implements the action behavior.
    • dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\Interpreter\WorkflowActionVisitor.cs wires it into execution as Prepare, Input, and Capture steps.
    • dotnet\src\Microsoft.Agents.AI.Workflows.Declarative\Entities\EntityExtractor.cs parses the human response into the configured entity/value type.

    At runtime the action roughly does this:

    1. Format/show the configured prompt.
    2. Emit an ExternalInputRequest.
    3. Wait for an ExternalInputResponse.
    4. Parse the response using the configured entity.
    5. Assign the parsed value to the configured workflow variable.
    6. Re-prompt or use default behavior when input is missing/invalid.

    A representative declarative shape is shown in #1530:

    - kind: Question
      variable: Local.Var5886
      id: action-1760649787072
      prompt: Please select a color
      entity:
        kind: EmbeddedEntity
        definition:
          kind: ClosedListEntity
          items:
            - id: option-1
              displayName: red
            - id: option-2
              displayName: yellow
      alwaysPrompt: false

    So I believe the gap in this issue is not runtime interpretation of Question; it is generating equivalent C# workflow code for declarative workflows that contain kind: Question, including the request/response port shape and variable/entity handling.

  5. Jokasa7 commented on Aug 28, 2026

    @Jokasa7

    Thanks for the implementation map, Vincent Biret (@baywet). I'd like to take the code-generation gap and request assignment. I would use the existing WorkflowActionVisitor.Visit(Question) and QuestionExecutor interpreted path as the behavior contract.

    Proposed first-PR scope:

    • generate a C# graph equivalent to the existing interpreter behavior, including the external-input request port, entity parsing, variable assignment, retry/default behavior, and alwaysPrompt semantics;
    • add a Question.yaml fixture and checked-in generated Question.cs baseline beside the existing workflow fixtures; and
    • verify the generated code compiles and cover valid input assignment, invalid input followed by reprompt, and retry exhaustion falling back to the configured default.

    I will keep changes to the existing interpreter/runtime out of scope unless implementing the generator exposes a shared defect. Does that match the intended first-PR boundary? If so, please assign #2802 to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

.NETUsage: [Issues, PRs], Target: .NetdeclarativeUsage: [Issues, PRs], Target: declarative agents and workflowsworkflowsUsage: [Issues, PRs], Target: Workflows

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions