This still returns a string. You need to explicitly program the branch to the right function. For example, check out how OpenAI Agents, released a week ago, rely on a workflow: https://github.com/openai/openai-agents-python/blob/48ff99bb...
Not sure about Cursor you mentioned as its agent is not open sourced.
The whole workflow and the Runner class is for one agent.
Check out this line: https://github.com/openai/openai-agents-python/blob/48ff99bb...
A single `run_agent` is implemented based on the Runner class and workflow. So usually the workflow is for one agent (unless there is handoff).
> An agent is an AI model configured with instructions, tools, guardrails, handoffs and more.
Agents can hand off to other agents, but even the hand-off is decided by the agent itself, not a pre-defined orchestration.