You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: daprdocs/content/en/developing-applications/dapr-agents/dapr-agents-core-concepts.md
+3-9Lines changed: 3 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,6 @@ async def main():
69
69
)
70
70
)
71
71
72
-
travel_planner.start()
73
72
runner = AgentRunner()
74
73
75
74
try:
@@ -79,8 +78,7 @@ async def main():
79
78
)
80
79
print(itinerary)
81
80
finally:
82
-
travel_planner.stop()
83
-
runner.shutdown()
81
+
runner.shutdown(travel_planner)
84
82
85
83
```
86
84
This example demonstrates creating a workflow-backed agent that runs autonomously in the background. The `AgentRunner` schedules the workflow for you, waits for completion, and ensures the agent can be triggered once yet continue execution across restarts.
The snippets below reuse this `travel_planner` instance to illustrate each mode.
275
272
276
273
#### 1. Ad-hoc execution with `runner.run(...)`
277
274
278
-
Use `run` when you want to trigger a durable workflow directly from Python code (tests, CLIs, notebooks, etc.). The runner locates the agent's `@workflow_entry`, schedules it, and optionally waits for completion. Call `travel_planner.start()` first so the workflow runtime is registered.
275
+
Use `run` when you want to trigger a durable workflow directly from Python code (tests, CLIs, notebooks, etc.). The runner locates the agent's `@workflow_entry`, schedules it, and optionally waits for completion.
0 commit comments