Skip to content

[Feature]: Let edge conditions read workflow state set by earlier executors #9450

Description

Problem

An edge condition is called with the message data only. It gets no WorkflowContext and no way to read workflow state. So a condition can't route on a value that an earlier executor saved with ctx.set_state(...)

Use Case and Evidence

a ──► b (asks the user for the priority) ──(role == "l1")──► c
                                         └─(role == "l2")──► d
  • a reads the user's message, works out the role (l1 or l2), saves it with ctx.set_state("role", ...), and sends on only the text.
  • b asks the user for the priority with request_info and waits. The answer comes in the next Teams message.
  • The b → c and b → d edges should pick the next executor by the role that a saved.

The conditions on b → c and b → d only get b's message (the text). They can't see role.

Desired Outcome

An edge condition (and a switch-case condition) can read the workflow state that earlier executors saved.

Alternatives Considered

Reading the state variables from the checkpoint by making a database call to load the checkpoint for every edge condition. This results in multiple database calls for each edge.

Proposed Direction

No response

Scope and Non-Goals

No response

Language

Both

Contribution Intent

I am willing to implement this

Acknowledgements

  • I searched existing issues and did not find a duplicate.
  • I will wait for explicit maintainer agreement before starting implementation of a non-trivial change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-maintainer-triageUsage: [Issues], Target: all issues that the automated triage flow failed to processtriageUsage: [Issues], Target: All issues that still need to be triaged

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions