Skip to content

Commit

Permalink
fix json workflow parameter validation bug (#1030)
Browse files Browse the repository at this point in the history
  • Loading branch information
wintonzheng authored Oct 23, 2024
1 parent 51a531d commit d81fcaa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion skyvern/forge/sdk/workflow/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,13 +569,14 @@ async def create_workflow_run_parameter(
workflow_parameter: WorkflowParameter,
value: Any,
) -> WorkflowRunParameter:
value = json.dumps(value) if isinstance(value, (dict, list)) else value
# InvalidWorkflowParameter will be raised if the validation fails
workflow_parameter.workflow_parameter_type.convert_value(value)

return await app.DATABASE.create_workflow_run_parameter(
workflow_run_id=workflow_run_id,
workflow_parameter=workflow_parameter,
value=json.dumps(value) if isinstance(value, (dict, list)) else value,
value=value,
)

async def get_workflow_run_parameter_tuples(
Expand Down

0 comments on commit d81fcaa

Please sign in to comment.