Validate all block parameters are defined in workflow (#4464)

This commit is contained in:
Stanislav Novosad
2026-01-15 14:08:30 -07:00
committed by GitHub
parent 5bfa0b0961
commit 5e23c580e7
3 changed files with 79 additions and 56 deletions

View File

@@ -90,7 +90,7 @@ from skyvern.forge.sdk.workflow.exceptions import (
FailedToCreateWorkflow,
FailedToUpdateWorkflow,
InvalidTemplateWorkflowPermanentId,
WorkflowParameterMissingRequiredValue,
WorkflowDefinitionValidationException,
)
from skyvern.forge.sdk.workflow.models.workflow import (
RunWorkflowResponse,
@@ -522,7 +522,7 @@ async def create_workflow_legacy(
return await app.WORKFLOW_SERVICE.create_workflow_from_request(
organization=current_org, request=workflow_create_request
)
except WorkflowParameterMissingRequiredValue as e:
except WorkflowDefinitionValidationException as e:
raise e
except Exception as e:
LOG.error("Failed to create workflow", exc_info=True, organization_id=current_org.organization_id)
@@ -583,7 +583,7 @@ async def create_workflow(
)
except yaml.YAMLError:
raise HTTPException(status_code=422, detail="Invalid YAML")
except WorkflowParameterMissingRequiredValue as e:
except WorkflowDefinitionValidationException as e:
raise e
except Exception as e:
LOG.error("Failed to create workflow", exc_info=True, organization_id=current_org.organization_id)
@@ -842,7 +842,7 @@ async def update_workflow_legacy(
status_code=422,
detail=str(e),
) from e
except WorkflowParameterMissingRequiredValue as e:
except WorkflowDefinitionValidationException as e:
raise e
except (SkyvernHTTPException, ValidationError) as e:
# Bubble up well-formed client errors so they are not converted to 500s
@@ -916,7 +916,7 @@ async def update_workflow(
)
except yaml.YAMLError:
raise HTTPException(status_code=422, detail="Invalid YAML")
except WorkflowParameterMissingRequiredValue as e:
except WorkflowDefinitionValidationException as e:
raise e
except (SkyvernHTTPException, ValidationError) as e:
# Bubble up well-formed client errors so they are not converted to 500s