Skip to content

Automate browser based workflows with AI

fix empty cache_key_value for block run cache (#3610)

Shuchang Zhengb985b5d0a0bd
diff --git a/skyvern/services/workflow_script_service.py b/skyvern/services/workflow_script_service.py
index 91ffb7fea..0dd052dc6 100644
--- a/skyvern/services/workflow_script_service.py
+++ b/skyvern/services/workflow_script_service.py
@@ -61,10 +61,6 @@ async def get_workflow_script(
cache_key = workflow.cache_key or ""
rendered_cache_key_value = ""
- if block_labels:
- # Do not generate script or run script if block_labels is provided
- return None, rendered_cache_key_value
-
try:
parameter_tuples = await app.DATABASE.get_workflow_run_parameters(
workflow_run_id=workflow_run.workflow_run_id,
@@ -73,6 +69,10 @@ async def get_workflow_script(
rendered_cache_key_value = jinja_sandbox_env.from_string(cache_key).render(parameters)
+ if block_labels:
+ # Do not generate script or run script if block_labels is provided
+ return None, rendered_cache_key_value
+
# Check if there are existing cached scripts for this workflow + cache_key_value
existing_scripts = await app.DATABASE.get_workflow_scripts_by_cache_key_value(
organization_id=workflow.organization_id,