Skip to content

Automate browser based workflows with AI

a noop change to log workflow_run_id when continue_on_failure failed during cached execution (#4714)

Shuchang Zheng7bcc70307642
diff --git a/skyvern/forge/sdk/workflow/service.py b/skyvern/forge/sdk/workflow/service.py
index 8fb3891d6..243587fd3 100644
--- a/skyvern/forge/sdk/workflow/service.py
+++ b/skyvern/forge/sdk/workflow/service.py
@@ -1450,6 +1450,23 @@ class WorkflowService:
):
blocks_to_update.add(block.label)
+ # Invalidate cache for blocks with continue_on_failure=True that failed
+ # This ensures the block runs fresh with AI on the next cached run
+ if (
+ block.label
+ and block.continue_on_failure
+ and workflow_run_block_result.status != BlockStatus.completed
+ and block.block_type in BLOCK_TYPES_THAT_SHOULD_BE_CACHED
+ and block.label in script_blocks_by_label
+ ):
+ blocks_to_update.add(block.label)
+ LOG.info(
+ "Block with continue_on_failure failed during cached execution, marking for regeneration",
+ block_label=block.label,
+ block_status=workflow_run_block_result.status,
+ workflow_run_id=workflow_run_id,
+ )
+
workflow_run, should_stop = await self._handle_block_result_status(
block=block,
block_idx=block_idx,