Implement cancel workflow run endpoint (#1188)

This commit is contained in:
Shuchang Zheng
2024-11-14 01:32:53 -08:00
committed by GitHub
parent d107c3d4db
commit 28d37545bc
4 changed files with 76 additions and 4 deletions

View File

@@ -345,6 +345,15 @@ async def cancel_task(
await app.agent.update_task(task_obj, status=TaskStatus.canceled)
@base_router.post("/workflows/runs/{workflow_run_id}/cancel")
@base_router.post("/workflows/runs/{workflow_run_id}/cancel/", include_in_schema=False)
async def cancel_workflow_run(
workflow_run_id: str,
current_org: Organization = Depends(org_auth_service.get_current_org),
) -> None:
await app.WORKFLOW_SERVICE.mark_workflow_run_as_canceled(workflow_run_id)
@base_router.post(
"/tasks/{task_id}/retry_webhook",
tags=["agent"],