From d4aa212f20a1639bbe68fd7702d2640ed51a307a Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Tue, 14 Oct 2025 17:09:19 -0700 Subject: [PATCH] add disable_cache to block (#3713) --- skyvern/forge/sdk/workflow/models/block.py | 1 + skyvern/forge/sdk/workflow/service.py | 8 +++++++- skyvern/schemas/workflows.py | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/skyvern/forge/sdk/workflow/models/block.py b/skyvern/forge/sdk/workflow/models/block.py index a17900ca..57eb460a 100644 --- a/skyvern/forge/sdk/workflow/models/block.py +++ b/skyvern/forge/sdk/workflow/models/block.py @@ -432,6 +432,7 @@ class BaseTaskBlock(Block): totp_verification_url: str | None = None totp_identifier: str | None = None cache_actions: bool = False + disable_cache: bool = False complete_verification: bool = True include_action_history_in_verification: bool = False download_timeout: float | None = None # minutes diff --git a/skyvern/forge/sdk/workflow/service.py b/skyvern/forge/sdk/workflow/service.py index f62ebce0..5f06bf37 100644 --- a/skyvern/forge/sdk/workflow/service.py +++ b/skyvern/forge/sdk/workflow/service.py @@ -644,7 +644,7 @@ class WorkflowService: # Try executing with script code if available block_executed_with_code = False - valid_to_run_code = block.label and block.label in script_blocks_by_label + valid_to_run_code = block.label and block.label in script_blocks_by_label and not block.disable_cache if valid_to_run_code: script_block = script_blocks_by_label[block.label] LOG.info( @@ -2517,6 +2517,7 @@ class WorkflowService: totp_verification_url=block_yaml.totp_verification_url, totp_identifier=block_yaml.totp_identifier, cache_actions=block_yaml.cache_actions, + disable_cache=block_yaml.disable_cache, complete_criterion=block_yaml.complete_criterion, terminate_criterion=block_yaml.terminate_criterion, complete_verification=block_yaml.complete_verification, @@ -2695,6 +2696,7 @@ class WorkflowService: totp_verification_url=block_yaml.totp_verification_url, totp_identifier=block_yaml.totp_identifier, cache_actions=block_yaml.cache_actions, + disable_cache=block_yaml.disable_cache, # DO NOT run complete verification for action block complete_verification=False, max_steps_per_run=1, @@ -2724,6 +2726,7 @@ class WorkflowService: totp_verification_url=block_yaml.totp_verification_url, totp_identifier=block_yaml.totp_identifier, cache_actions=block_yaml.cache_actions, + disable_cache=block_yaml.disable_cache, complete_criterion=block_yaml.complete_criterion, terminate_criterion=block_yaml.terminate_criterion, complete_verification=block_yaml.complete_verification, @@ -2750,6 +2753,7 @@ class WorkflowService: model=block_yaml.model, continue_on_failure=block_yaml.continue_on_failure, cache_actions=block_yaml.cache_actions, + disable_cache=block_yaml.disable_cache, complete_verification=False, ) @@ -2775,6 +2779,7 @@ class WorkflowService: totp_verification_url=block_yaml.totp_verification_url, totp_identifier=block_yaml.totp_identifier, cache_actions=block_yaml.cache_actions, + disable_cache=block_yaml.disable_cache, complete_criterion=block_yaml.complete_criterion, terminate_criterion=block_yaml.terminate_criterion, complete_verification=block_yaml.complete_verification, @@ -2814,6 +2819,7 @@ class WorkflowService: totp_verification_url=block_yaml.totp_verification_url, totp_identifier=block_yaml.totp_identifier, cache_actions=block_yaml.cache_actions, + disable_cache=block_yaml.disable_cache, complete_on_download=True, complete_verification=True, download_timeout=block_yaml.download_timeout, diff --git a/skyvern/schemas/workflows.py b/skyvern/schemas/workflows.py index 1c6b0a56..be067350 100644 --- a/skyvern/schemas/workflows.py +++ b/skyvern/schemas/workflows.py @@ -223,6 +223,7 @@ class TaskBlockYAML(BlockYAML): totp_verification_url: str | None = None totp_identifier: str | None = None cache_actions: bool = False + disable_cache: bool = False complete_criterion: str | None = None terminate_criterion: str | None = None complete_verification: bool = True @@ -359,6 +360,7 @@ class ActionBlockYAML(BlockYAML): totp_verification_url: str | None = None totp_identifier: str | None = None cache_actions: bool = False + disable_cache: bool = False class NavigationBlockYAML(BlockYAML): @@ -379,6 +381,7 @@ class NavigationBlockYAML(BlockYAML): totp_verification_url: str | None = None totp_identifier: str | None = None cache_actions: bool = False + disable_cache: bool = False complete_criterion: str | None = None terminate_criterion: str | None = None complete_verification: bool = True @@ -397,6 +400,7 @@ class ExtractionBlockYAML(BlockYAML): max_steps_per_run: int | None = None parameter_keys: list[str] | None = None cache_actions: bool = False + disable_cache: bool = False class LoginBlockYAML(BlockYAML): @@ -413,6 +417,7 @@ class LoginBlockYAML(BlockYAML): totp_verification_url: str | None = None totp_identifier: str | None = None cache_actions: bool = False + disable_cache: bool = False complete_criterion: str | None = None terminate_criterion: str | None = None complete_verification: bool = True @@ -440,6 +445,7 @@ class FileDownloadBlockYAML(BlockYAML): totp_verification_url: str | None = None totp_identifier: str | None = None cache_actions: bool = False + disable_cache: bool = False download_timeout: float | None = None