Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
add disable_cache to block (#3713)
Shuchang Zhengd4aa212f20a1
diff --git a/skyvern/forge/sdk/workflow/models/block.py b/skyvern/forge/sdk/workflow/models/block.pyindex a17900ca1..57eb460ad 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 = Nonetotp_identifier: str | None = Nonecache_actions: bool = False+ disable_cache: bool = Falsecomplete_verification: bool = Trueinclude_action_history_in_verification: bool = Falsedownload_timeout: float | None = None # minutesdiff --git a/skyvern/forge/sdk/workflow/service.py b/skyvern/forge/sdk/workflow/service.pyindex f62ebce09..5f06bf373 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 availableblock_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_cacheif 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 blockcomplete_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.pyindex 1c6b0a566..be0673506 100644--- a/skyvern/schemas/workflows.py+++ b/skyvern/schemas/workflows.py@@ -223,6 +223,7 @@ class TaskBlockYAML(BlockYAML):totp_verification_url: str | None = Nonetotp_identifier: str | None = Nonecache_actions: bool = False+ disable_cache: bool = Falsecomplete_criterion: str | None = Noneterminate_criterion: str | None = Nonecomplete_verification: bool = True@@ -359,6 +360,7 @@ class ActionBlockYAML(BlockYAML):totp_verification_url: str | None = Nonetotp_identifier: str | None = Nonecache_actions: bool = False+ disable_cache: bool = Falseclass NavigationBlockYAML(BlockYAML):@@ -379,6 +381,7 @@ class NavigationBlockYAML(BlockYAML):totp_verification_url: str | None = Nonetotp_identifier: str | None = Nonecache_actions: bool = False+ disable_cache: bool = Falsecomplete_criterion: str | None = Noneterminate_criterion: str | None = Nonecomplete_verification: bool = True@@ -397,6 +400,7 @@ class ExtractionBlockYAML(BlockYAML):max_steps_per_run: int | None = Noneparameter_keys: list[str] | None = Nonecache_actions: bool = False+ disable_cache: bool = Falseclass LoginBlockYAML(BlockYAML):@@ -413,6 +417,7 @@ class LoginBlockYAML(BlockYAML):totp_verification_url: str | None = Nonetotp_identifier: str | None = Nonecache_actions: bool = False+ disable_cache: bool = Falsecomplete_criterion: str | None = Noneterminate_criterion: str | None = Nonecomplete_verification: bool = True@@ -440,6 +445,7 @@ class FileDownloadBlockYAML(BlockYAML):totp_verification_url: str | None = Nonetotp_identifier: str | None = Nonecache_actions: bool = False+ disable_cache: bool = Falsedownload_timeout: float | None = None