Fix video recording persistence for workflow script execution #3385
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
clean_up_workflowcalls in both success and failure cases of_execute_workflow_scriptProblem
The workflow script execution path (
_execute_workflow_script) was missing the cleanup step that persists video recordings and other artifacts. This resulted in video recordings not being saved when workflows used script execution instead of the normal block execution path.Solution
Added
clean_up_workflowcalls in the_execute_workflow_scriptmethod:This ensures video data is persisted regardless of execution outcome and maintains consistency with the normal workflow execution path.
Test plan
clean_up_workflow🤖 Generated with Claude Code
🎥 This PR fixes a critical bug where video recordings were not being persisted when workflows used script execution instead of the normal block execution path, ensuring consistent video recording behavior across all workflow execution types.
🔍 Detailed Analysis
Key Changes
clean_up_workflowcalls in both success and failure paths of_execute_workflow_scriptmethodTechnical Implementation
sequenceDiagram participant WS as Workflow Script participant WR as Workflow Run participant CU as Clean Up Workflow participant VS as Video Storage WS->>WR: Execute workflow script alt Success Case WR->>WR: Mark as completed WR->>CU: clean_up_workflow() CU->>VS: Persist video recordings else Failure Case WR->>WR: Mark as failed WR->>CU: clean_up_workflow() (with try/catch) CU->>VS: Persist video recordings Note over CU: Cleanup errors logged but don't affect workflow status endImpact
Created with Palmier
Important
Adds
clean_up_workflowcalls in_execute_workflow_scriptto ensure video recordings are saved for both success and failure cases.clean_up_workflowcalls in_execute_workflow_scriptto ensure video recordings are saved._execute_workflow_scriptinservice.pyto include cleanup after marking workflow run as completed or failed.This description was created by
for 82adff9. You can customize this summary. It will automatically update as commits are pushed.