Repository navigation
fix(workflows): hold the v2 sync run result until its execution log is finalized - #8935
Merged
Merged
Conversation
…s finalized The v2 sync execute path (executeWorkflowService) returned a completed run while executeWorkflowCore was still writing its log and execution state in the background, so a run-from-block naming that run as its source could read no state and 404. The legacy execute route already awaits waitForPostExecution before responding; do the same here.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
There was a problem hiding this comment.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
Turn on auto-fix | Re-trigger cubic
Contributor
|
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
A run-from-block call that names a just-finished v2 sync run as its source can fail with
NOT_FOUND: No execution state found for source run. CI hit this ine2e (stop-after)(run 38262284889, attempt 1; it passed on rerun), and any v2 API, CLI or MCP caller can hit it the same way.Cause. After a run finishes, the core writes its log and saved execution state in a background step (
execution-core.ts).runSynchronousWorkflowinexecute-service.tsreturned thecompletedresult without waiting for that step. Run-from-block reads the state from the primary DB, found the log row with no state yet, and returned 404. In the CI log the source run passed at 14:24:52.750 and the CLI failed at 14:24:53.773, while the write was still in flight.Fix. Await
loggingSession.waitForPostExecution()inrunSynchronousWorkflow'sfinally, as the legacy execute route already does ("the sync response is the run's receipt"). It covers completed, failed, cancelled, timed-out and thrown runs, and does nothing after a pause. The wait swallows errors and the background step always settles, so it can't hang the response. This is not a retry.Trade-off. v2 sync responses now include the time to save the log, the same as the legacy route.
Test plan
e2e (stop-after)and the v2 execute suites