Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/agentex/lib/core/temporal/workflows/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ def __init__(
):
self.display_name = display_name

@workflow.query(name="get_current_state")
def get_current_state(self) -> str:
"""Query handler for the current workflow state.

Returns "unknown" by default. Subclasses should override this
to return their actual state, enabling external callers to
detect turn completion.

Example override for StateMachine-based agents:

@workflow.query(name="get_current_state")
def get_current_state(self) -> str:
return self.state_machine.get_current_state()
"""
return "unknown"

@abstractmethod
@workflow.signal(name=SignalName.RECEIVE_EVENT)
async def on_task_event_send(self, params: SendEventParams) -> None:
Expand Down
Loading