Run cancellation provides the ability to stop running agent, team, or workflow executions. This feature is useful for managing long-running operations, implementing timeouts, or allowing users to interrupt processes.Documentation Index
Fetch the complete documentation index at: https://agno-v2-shaloo-ai-support-link.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
How It Works
Thecancel_run() function marks a run for cancellation. Execution stops gracefully once the current step completes, ensuring that operations finish cleanly without leaving resources in an inconsistent state.
Cancellation Behavior:
- Non-Streaming Runs: The
RunOutputobject is returned with status set toRunStatus.cancelled. - Streaming Runs: A
RunCancelledEventis emitted when cancellation occurs.
Cancellation Methods
Agent Run Cancellation
Cancel agent runs programmatically or via API endpoints.
Team Run Cancellation
Cancel team runs and handle member run cancellations.
Workflow Run Cancellation
Cancel workflow executions and manage step-level cancellation.