Skip to content

Commit

Permalink
fix workflow incorrectly failed (Skyvern-AI#1312)
Browse files Browse the repository at this point in the history
  • Loading branch information
LawyZheng authored Dec 3, 2024
1 parent a206f51 commit 862508e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions skyvern/forge/sdk/workflow/context_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from skyvern.exceptions import BitwardenBaseError, WorkflowRunContextNotInitialized
from skyvern.forge.sdk.api.aws import AsyncAWSClient
from skyvern.forge.sdk.models import Organization
from skyvern.forge.sdk.schemas.tasks import TaskStatus
from skyvern.forge.sdk.services.bitwarden import BitwardenConstants, BitwardenService
from skyvern.forge.sdk.workflow.exceptions import OutputParameterKeyCollisionError
from skyvern.forge.sdk.workflow.models.parameter import (
Expand Down Expand Up @@ -374,6 +375,14 @@ async def set_parameter_values_for_output_parameter_dependent_blocks(
and isinstance(parameter.source, OutputParameter)
and parameter.source.key == output_parameter.key
):
# If task isn't completed, we should skip setting the value
if (
isinstance(value, dict)
and "extracted_information" in value
and "status" in value
and value["status"] != TaskStatus.completed
):
continue
if isinstance(value, dict) and "errors" in value and value["errors"]:
# Is this the correct way to handle errors from task blocks?
LOG.error(
Expand Down

0 comments on commit 862508e

Please sign in to comment.