-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(deployments): make deployed state source of truth for non-manual executions + versioning #1242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… executions + versioning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Summary
This PR introduces a comprehensive deployment versioning system that makes deployed workflow versions the single source of truth for all non-manual executions (webhooks, schedules, API calls, and chat). The core architectural change replaces the previous approach of using live workflow state or a single deployedState
field with a dedicated workflow_deployment_version
table that supports multiple versioned deployments.
The implementation adds:
- A new
workflowDeploymentVersion
table with proper indexing, foreign key constraints, and unique version constraints per workflow - API endpoints for managing deployment versions (
/deployments
,/deployments/[version]
,/deployments/[version]/activate
,/deployments/[version]/revert
) - Updated UI components to display version management capabilities, including version history, activation controls, and preview functionality
- Migration of existing workflows through a comprehensive script that creates initial deployment versions for backward compatibility
Key components modified include workflow execution engines (webhooks, schedules), deployment management UI, and database helpers. The system now ensures that automated executions use stable, versioned snapshots rather than potentially changing live state, enabling better deployment management, rollback capabilities, and consistency across all execution types. The changes maintain backward compatibility through the migration script while establishing a more robust foundation for workflow deployment management.
Confidence score: 3/5
- This PR requires careful review due to complex architectural changes affecting critical execution paths
- Score reflects the significant database schema changes, migration complexity, and potential for execution failures if deployed state is missing
- Pay close attention to migration script, deployment version creation logic, and error handling in execution engines
23 files reviewed, 14 comments
...[workspaceId]/w/[workflowId]/components/control-bar/components/deploy-modal/deploy-modal.tsx
Outdated
Show resolved
Hide resolved
...components/control-bar/components/deployment-controls/components/deployed-workflow-modal.tsx
Outdated
Show resolved
Hide resolved
apps/sim/app/api/workflows/[id]/deployments/[version]/revert/route.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Summary
This review covers only the changes made since the last review, not the entire PR. The latest changes involve three key modifications to support deployment versioning architecture:
-
ChatDeploy Component Enhancement: Added an optional
onDeployed
callback prop to the ChatDeploy component. This callback is invoked after successful chat deployment and enables parent components to react to deployment completion by updating state or triggering related processes. -
DeployModal State Management Updates: Modified the
handleWorkflowPreDeploy
function to always create new deployment versions regardless of current deployment state, removing the previous conditional logic that only deployed if not already deployed. Added anonDeployed
callback to the ChatDeploy component that handles post-deployment state updates including refetching deployed state, fetching versions, and clearing redeployment flags. -
Chat Execution Architecture Refactor: Refactored chat execution in
utils.ts
to use the deployment versions table as the authoritative source instead of the deprecateddeployedState
field on the workflow table. The change removes thedeployedState
field from database queries and replaces it with a call toloadDeployedWorkflowState()
which retrieves active deployed state from theworkflowDeploymentVersion
table.
These changes are part of a larger architectural shift to centralize deployment state management and ensure that all non-manual executions (webhooks, schedules, API, chat) reference the same authoritative deployed state from the versions table rather than inconsistent live state.
Confidence score: 4/5
- This PR appears safe to merge with careful attention to testing
- Score reflects architectural changes that modify core deployment behavior but follow established patterns
- Pay close attention to chat execution flow and deployment state management logic
3 files reviewed, no comments
Summary
Make deployed versions table be the source of truth for workflow state being executed by Webhooks, Schedules, API, Chat.
Script to make every workflow have a row since webhooks and schedules previously depended on live state.
High risk migration + type changes
Type of Change
Testing
Tested manually with @aadamgough
Checklist