Skip to content

Commit

Permalink
fix forloop output parameter issue (#1490)
Browse files Browse the repository at this point in the history
  • Loading branch information
LawyZheng authored Jan 5, 2025
1 parent 100dcb0 commit 240b75c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions skyvern/forge/sdk/workflow/models/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,13 @@ async def execute(
try:
self.format_potential_template_parameters(workflow_run_context=workflow_run_context)
except Exception as e:
failure_reason = f"Failed to format jinja template: {str(e)}"
await self.record_output_parameter_value(
workflow_run_context, workflow_run_id, {"failure_reason": failure_reason}
)
return await self.build_block_result(
success=False,
failure_reason=f"Failed to format jinja template: {str(e)}",
failure_reason=failure_reason,
output_parameter_value=None,
status=BlockStatus.failed,
workflow_run_block_id=workflow_run_block_id,
Expand Down Expand Up @@ -843,7 +847,9 @@ async def execute_loop_helper(
{
"loop_value": loop_over_value,
"output_parameter": block_output.output_parameter,
"output_value": workflow_run_context.get_value(block_output.output_parameter.key),
"output_value": workflow_run_context.get_value(block_output.output_parameter.key)
if workflow_run_context.has_value(block_output.output_parameter.key)
else None,
}
)
try:
Expand Down

0 comments on commit 240b75c

Please sign in to comment.