Skip to content

41258 backend [workflows] Delete outdated workflows api response data - #314

Open
andrey-usov wants to merge 6 commits into
masterfrom
backend/workflows/41258__delete_outdated_api_response_data
Open

41258 backend [workflows] Delete outdated workflows api response data#314
andrey-usov wants to merge 6 commits into
masterfrom
backend/workflows/41258__delete_outdated_api_response_data

Conversation

@andrey-usov

@andrey-usov andrey-usov commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

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, the save() override that kept it
    up to date, and everything that read it: TemplateQuerySet.workflows_updated_from,
    workflows_updated_to, avg_workflow_duration and the WorkflowDurationFilter /
    WorkflowSuccessRateFilter filtersets, which were not attached to any view. Migration
    0260_remove_workflow_status_updated.

Not in this PR: task.is_completed. The task asks to drop it and derive the value from
performers, but that is not possible for group performers: when a group member completes his
part under require_completion_by_all, the completion is stored in a hidden GROUP_USER row,
and performers only exposes user and group rows. The item was cancelled after review, the
field and its tests are restored in c665670c.

Not in this PR: workflow-level due_date_tsp. The process-page widget is hidden, but the
progress 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_updated dropped from the database
  • GET /workflows, GET /workflows/:id, PATCH/run responses and workflow webhooks keep
    due_date_tsp
  • GET /v2/tasks/:id keeps top-level is_completed

Web-client: No changes.

Test cases

API:

Authorization Test case Expected result
Account owner GET /workflows due_date_tsp still present
Account owner GET /workflows/:id due_date_tsp still present
Account owner PATCH /workflows/:id with due_date_tsp Accepts input, saves to model, response contains due_date_tsp
Account owner POST /templates/:id/run with due_date_tsp Accepts input, saves to model, response contains due_date_tsp
Account owner GET /v2/tasks/:id is_completed still present at top level and true after the user completed his part of a require_completion_by_all task
Account owner GET /v2/tasks/:id sub_workflows, performers[].is_completed and task-level due_date_tsp still present
Account owner Workflow started webhook Payload still contains due_date_tsp
Account owner Task completed webhook due_date_tsp present on nested workflow, is_completed still present at task level
Account owner Any workflow status change Status changes are applied, no error from the removed status_updated column

Web-client: No changes — no test cases.

Made with Cursor

Note

Remove status_updated field and related workflow duration/success-rate filters

  • Removes the status_updated DateTimeField from the Workflow model via 0260_remove_workflow_status_updated.py and drops the save override that maintained it
  • Deletes WorkflowDurationFilter and WorkflowSuccessRateFilter from filters.py, which exposed date_from/date_to filters backed by workflows_updated_from/workflows_updated_to\n- Removes workflows_updated_from, workflows_updated_to, and avg_workflow_duration from querysets.py since they depended on workflows__status_updated
  • Updates tests, fixtures, and the workflow creation path in workflow.py to stop referencing status_updated
  • Risk: any out-of-tree code importing Workflow.status_updated, WorkflowDurationFilter, WorkflowSuccessRateFilter, or the three deleted TemplateQuerySet methods will fail; in-tree callers are already cleaned up

Macroscope summarized 9d63d4a.

- 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>
@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot 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
andrey-usov requested a review from pneumojoseph July 30, 2026 17:24
@andrey-usov andrey-usov added the Backend API changes request label Jul 30, 2026
@pneumojoseph

Copy link
Copy Markdown
Collaborator

@andrey-usov Workflow.status_updated is used ?

@pneumojoseph pneumojoseph changed the title 🧹41258 backend [workflows] Delete outdated workflows api response data 41258 backend [workflows] Delete outdated workflows api response data Aug 19, 2026
- 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>
@andrey-usov

Copy link
Copy Markdown
Collaborator Author

@pneumojoseph No, it's dead. The field is written on every status change, but the only
readers are workflows_updated_from / workflows_updated_to / avg_workflow_duration
in querysets.py, and those are called only from WorkflowDurationFilter and
WorkflowSuccessRateFilter — two filter sets that aren't attached to any view. It was
never in API responses either.

Removed the field, the dead filters and added migration 0259. Tests are green.

Comment thread backend/src/processes/serializers/workflows/task.py
Comment thread frontend/src/public/redux/task/saga.ts Outdated
Comment thread frontend/src/public/utils/tasks.ts Outdated
@andrey-usov
andrey-usov force-pushed the backend/workflows/41258__delete_outdated_api_response_data branch from c5473ab to 9cdc605 Compare August 20, 2026 13:45
andrey-usov and others added 3 commits August 20, 2026 17:38
- 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>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread backend/src/processes/serializers/workflows/workflow.py
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backend API changes request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants