Skip to content

Swap 5222 user office experiment workflow improvement#1391

Open
yoganandaness wants to merge 2 commits intoSWAP-4949-workflow-overhaulfrom
SWAP-5222-user-office-experiment-workflow-improvement
Open

Swap 5222 user office experiment workflow improvement#1391
yoganandaness wants to merge 2 commits intoSWAP-4949-workflow-overhaulfrom
SWAP-5222-user-office-experiment-workflow-improvement

Conversation

@yoganandaness
Copy link
Contributor

This pull request introduces a major overhaul of the workflow data structures and migrates existing workflow data to the new schema. The changes are focused on improving workflow management, enabling more flexible graph-based workflows, and ensuring data integrity during migration. The update includes new tables, foreign key relationships, triggers, and migration scripts to transition all relevant data and references.

Schema redesign for workflow management:

  • Added new tables: workflow_has_statuses, workflow_status_connections, workflow_status_connection_has_workflow_status_changing_events, and workflow_status_connection_has_workflow_status_actions to support graph-based workflows, status transitions, and associated events/actions.
  • Updated the workflows table to include an updated_at timestamp, and renamed status_actions to workflow_status_actions for clarity.

Migration and data integrity:

  • Created comprehensive migration logic to transfer existing workflow nodes, edges, actions, and events to the new tables, with checks for unmapped data and warnings for any migration issues.
  • Updated references in proposals and experiment_safety tables to link to the new workflow graph, and added triggers to keep status_id in sync with the new workflow_status_id. [1] [2]

Cleanup and deprecation:

  • Removed deprecated tables and sequences related to the old workflow system, such as workflow_connections, workflow_connection_has_actions, and status_changing_events, after successful migration.

Event and action handling changes:

  • Events are now stored as strings in application code instead of a dedicated catalog table, simplifying event management and reducing schema complexity.

Referential integrity and constraints:

  • Enforced new foreign key and unique constraints to ensure all workflow transitions and actions/events are valid and prevent duplication or orphaned records. [1] [2]

Description

Motivation and Context

How Has This Been Tested

Fixes

Changes

Depends on

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

@yoganandaness yoganandaness requested a review from a team as a code owner March 2, 2026 08:24
@yoganandaness yoganandaness requested review from ACLay and removed request for a team March 2, 2026 08:24
@yoganandaness yoganandaness changed the base branch from develop to SWAP-4949-workflow-overhaul March 2, 2026 08:25
@yoganandaness yoganandaness removed the request for review from ACLay March 2, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant