Return 409 on workflow updates race conditions (#4510)

This commit is contained in:
Stanislav Novosad
2026-01-21 15:45:52 -07:00
committed by GitHub
parent f879f4983c
commit f781a6f0ef
2 changed files with 38 additions and 24 deletions

View File

@@ -54,6 +54,14 @@ class FailedToUpdateWorkflow(BaseWorkflowHTTPException):
)
class WorkflowVersionConflict(BaseWorkflowHTTPException):
def __init__(self, workflow_permanent_id: str) -> None:
super().__init__(
f"Concurrent update detected for workflow {workflow_permanent_id}. Please retry.",
status_code=status.HTTP_409_CONFLICT,
)
class OutputParameterKeyCollisionError(BaseWorkflowHTTPException):
def __init__(self, key: str, retry_count: int | None = None) -> None:
message = f"Output parameter key {key} already exists in the context manager."