Add "Execute on Any Outcome" (Finally) option to blocks - Pair Team request (#4443)

This commit is contained in:
Marc Kelechava
2026-01-13 16:56:06 -08:00
committed by GitHub
parent b321402ba9
commit 40a743e5ca
26 changed files with 373 additions and 49 deletions

View File

@@ -20,6 +20,24 @@ class WorkflowDefinitionHasDuplicateBlockLabels(BaseWorkflowHTTPException):
)
class InvalidFinallyBlockLabel(BaseWorkflowHTTPException):
def __init__(self, finally_block_label: str, available_labels: list[str]) -> None:
super().__init__(
f"finally_block_label '{finally_block_label}' does not reference a valid block in the workflow. "
f"Available block labels: {', '.join(available_labels) if available_labels else '(none)'}",
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
)
class NonTerminalFinallyBlock(BaseWorkflowHTTPException):
def __init__(self, finally_block_label: str) -> None:
super().__init__(
f"finally_block_label '{finally_block_label}' must be a terminal block (next_block_label must be null). "
"Only blocks without a next_block_label can be used as finally blocks.",
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
)
class FailedToCreateWorkflow(BaseWorkflowHTTPException):
def __init__(self, error_message: str) -> None:
super().__init__(