Skip to content

Automate browser based workflows with AI

fix task v2 script generation (#4546)

Shuchang Zheng3308faae610f
diff --git a/skyvern/services/task_v2_service.py b/skyvern/services/task_v2_service.py
index 043f76494..af844af3e 100644
--- a/skyvern/services/task_v2_service.py
+++ b/skyvern/services/task_v2_service.py
@@ -755,6 +755,10 @@ async def run_task_v2_helper(
context=context,
screenshots=scraped_page.screenshots,
)
+ await app.WORKFLOW_SERVICE.generate_script_if_needed(
+ workflow=workflow,
+ workflow_run=workflow_run,
+ )
break
if not plan:
@@ -963,11 +967,10 @@ async def run_task_v2_helper(
context=context,
screenshots=completion_screenshots,
)
- if task_v2.run_with == "code":
- await app.WORKFLOW_SERVICE.generate_script_if_needed(
- workflow=workflow,
- workflow_run=workflow_run,
- )
+ await app.WORKFLOW_SERVICE.generate_script_if_needed(
+ workflow=workflow,
+ workflow_run=workflow_run,
+ )
break
# total step number validation