fix workflow cleanup bug when there are no tasks created for the workflow (#1279)

This commit is contained in:
Shuchang Zheng 2024-11-27 15:32:44 -08:00 committed by GitHub
parent 008369217b
commit eec7e7c40c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -820,7 +820,8 @@ class WorkflowService:
)
if browser_state:
await self.persist_video_data(browser_state, workflow, workflow_run)
await self.persist_debug_artifacts(browser_state, tasks[-1], workflow, workflow_run)
if tasks:
await self.persist_debug_artifacts(browser_state, tasks[-1], workflow, workflow_run)
if workflow.persist_browser_session and browser_state.browser_artifacts.browser_session_dir:
await app.STORAGE.store_browser_session(
workflow.organization_id,