41258 backend [workflows] Delete outdated workflows api response data - #314
41258 backend [workflows] Delete outdated workflows api response data#314andrey-usov wants to merge 6 commits into
Conversation
- Remove `is_completed` from TaskSerializer response (GET /v2/tasks/:id) - Remove `due_date_tsp` from WorkflowListSerializer (GET /workflows) - Remove `due_date_tsp` from WorkflowDetailsSerializer (GET /workflows/:id) - Webhook payloads updated automatically (use same serializers) - Input serializers (create/update/filter) unchanged - Update tests to match new response shape Co-authored-by: Cursor <cursoragent@cursor.com>
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
|
@andrey-usov Workflow.status_updated is used ? |
- Field was set on every status change but never read: the only readers were WorkflowDurationFilter and WorkflowSuccessRateFilter, which are not attached to any view - Drop the field, the save() override and three queryset methods (workflows_updated_from, workflows_updated_to, avg_workflow_duration) - Drop both dead filter sets and update the tests that set the field - Migration 0259 removes the column together with its index Co-authored-by: Cursor <cursoragent@cursor.com>
|
@pneumojoseph No, it's dead. The field is written on every status change, but the only Removed the field, the dead filters and added migration |
c5473ab to
9cdc605
Compare
- Restore the field, get_is_completed and the tests dropped in a5ded90 - A group member completion is stored in a hidden GROUP_USER row that performers does not expose, so clients cannot derive the value - The item is removed from the task scope after review Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…erge - master brought 0259_populate_fieldset_title_from_name, leaving two leaf nodes in the processes migration graph - Renamed ours to 0260 and moved its dependency onto the master one Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1ab8f3f. Configure here.
- Restore the field on WorkflowListSerializer and WorkflowDetailsSerializer - Progress bar and public GET/webhooks still read it; the process-page widget is hidden - The item is moved to a follow-up after review Co-authored-by: Cursor <cursoragent@cursor.com>

Problem
Workflow and task responses carry fields that no client uses. They inflate every response,
make the API harder to maintain and slow down any further change in this area.
Fix / Solution
Workflow.status_updated— removed the model field, thesave()override that kept itup to date, and everything that read it:
TemplateQuerySet.workflows_updated_from,workflows_updated_to,avg_workflow_durationand theWorkflowDurationFilter/WorkflowSuccessRateFilterfiltersets, which were not attached to any view. Migration0260_remove_workflow_status_updated.Not in this PR:
task.is_completed. The task asks to drop it and derive the value fromperformers, but that is not possible for group performers: when a group member completes hispart under
require_completion_by_all, the completion is stored in a hiddenGROUP_USERrow,and
performersonly exposesuserandgrouprows. The item was cancelled after review, thefield and its tests are restored in
c665670c.Not in this PR: workflow-level
due_date_tsp. The process-page widget is hidden, but theprogress bar and public GET/webhooks still read the field. Moved to a follow-up; restored in
9d63d4a1.Not changed: input serializers (
WorkflowCreateSerializer,WorkflowUpdateSerializer),filter serializers (
TaskListFilterSerializer), event serializers (SubWorkflowEventSerializer,TaskEventJsonSerializer), raw SQL queries.Release notes
No user-facing changes. An unused internal workflow timestamp has been removed from the
database. Workflow and task due dates in API responses are unchanged.
Changes
API:
Workflow.status_updateddropped from the databaseGET /workflows,GET /workflows/:id, PATCH/run responses and workflow webhooks keepdue_date_tspGET /v2/tasks/:idkeeps top-levelis_completedWeb-client: No changes.
Test cases
API:
GET /workflowsdue_date_tspstill presentGET /workflows/:iddue_date_tspstill presentPATCH /workflows/:idwithdue_date_tspdue_date_tspPOST /templates/:id/runwithdue_date_tspdue_date_tspGET /v2/tasks/:idis_completedstill present at top level andtrueafter the user completed his part of arequire_completion_by_alltaskGET /v2/tasks/:idsub_workflows,performers[].is_completedand task-leveldue_date_tspstill presentdue_date_tspdue_date_tsppresent on nestedworkflow,is_completedstill present at task levelstatus_updatedcolumnWeb-client: No changes — no test cases.
Made with Cursor
Note
Remove
status_updatedfield and related workflow duration/success-rate filtersstatus_updatedDateTimeField from theWorkflowmodel via 0260_remove_workflow_status_updated.py and drops thesaveoverride that maintained itWorkflowDurationFilterandWorkflowSuccessRateFilterfrom filters.py, which exposeddate_from/date_tofilters backed byworkflows_updated_from/workflows_updated_to\n- Removesworkflows_updated_from,workflows_updated_to, andavg_workflow_durationfrom querysets.py since they depended onworkflows__status_updatedstatus_updatedWorkflow.status_updated,WorkflowDurationFilter,WorkflowSuccessRateFilter, or the three deletedTemplateQuerySetmethods will fail; in-tree callers are already cleaned upMacroscope summarized 9d63d4a.