🔧 29571 backend [workflows] Allow resume ended workflows#266
Open
andrey-usov wants to merge 1 commit into
Open
🔧 29571 backend [workflows] Allow resume ended workflows#266andrey-usov wants to merge 1 commit into
andrey-usov wants to merge 1 commit into
Conversation
Enable POST /workflows/:id/resume for WorkflowStatus.DONE by clearing date_completed and returning to RUNNING; show Resume in UI for finished workflows. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Problem
POST /workflows/:id/resumeonly worked for snoozed (DELAYED) workflows. Calling it for a finished workflow (WorkflowStatus.DONE) returned 400 withMSG_PW_0017(“Completed workflow cannot be changed.”). Users need to bring a completed workflow back toRUNNINGvia API and the Resume control in the UI.Fix / Solution
POST /workflows/:id/resumeforWorkflowStatus.DONE.force_resume_workflow, remove the completed-workflow guard, cleardate_completed, set status toRUNNING, and keep existing delayed-task resume / notification /FORCE_RESUMElog behavior.WorkflowControlls.Release notes
Finished workflows can be resumed from the workflow menu and via
POST /workflows/:id/resume, returning the workflow to Running without using return-to-task.Changes
Summary
POST /workflows/:id/resumeforWorkflowStatus.DONE.force_resume_workflowclearsdate_completedand setsRUNNING.API
POST /workflows/:id/resumeaccepts finished (DONE) workflows and returns 200 withstatus=RUNNINGanddate_completed=null.Web-client
Test plan
Automated (pytest)
src/processes/tests/test_services/test_workflow_action_service.py—force_resumecases forDONE(including rewritten completed-workflow test).src/processes/tests/test_views/test_workflow/test_resume.py— API resume forDONEworkflows.resume_taskstill rejects completed workflow on Celery path.Suggested commands:
Manual
POST /workflows/:id/resume— 200, workflow Running,date_completedcleared.Made with Cursor
Note
Allow resume for completed workflows in addition to snoozed workflows
WorkflowActionService.force_resume_workflowpreviously raisedResumeCompletedWorkflowwhen called on a completed workflow; it now sets status toRUNNINGand clearsdate_completedinstead.WorkflowControlls.tsxnow enables the Resume button for workflows inFinishedstatus, not onlySnoozed.ResumeCompletedWorkflowto be raised will no longer receive it.📊 Macroscope summarized 4841730. 2 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.