Skip to main content
This example demonstrates how to cancel a running workflow execution by starting a workflow run in a separate thread and cancelling it from another thread. It shows proper handling of cancelled responses and thread management.

Example

workflow_cancel_run.py

API Endpoint

Workflow runs can be cancelled via the AgentOS API:
Example:
Reference: Cancel Workflow Run API