-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(admin): routes to manage deployments #2667
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
Merged
Merged
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryExtracted deployment logic into reusable helper functions and added new admin API routes for managing workflow deployments. The refactoring eliminates code duplication by moving Key Changes:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Admin as Admin API
participant Route as Admin Route Handler
participant Helper as Persistence Utils
participant DB as Database
participant Schedule as Schedule Manager
Note over Admin,Schedule: Deploy Workflow Flow
Admin->>Route: POST /api/v1/admin/workflows/:id/deploy
Route->>DB: Check workflow exists
DB-->>Route: Workflow record
Route->>Helper: loadWorkflowFromNormalizedTables(workflowId)
Helper->>DB: Load blocks, edges, subflows
DB-->>Helper: Normalized workflow data
Helper-->>Route: Workflow state
Route->>Route: validateWorkflowSchedules(blocks)
Route->>Helper: deployWorkflow({workflowId, deployedBy, workflowName})
Helper->>DB: Begin transaction
Helper->>DB: Get max version number
Helper->>DB: Deactivate all existing versions
Helper->>DB: Insert new deployment version
Helper->>DB: Update workflow.isDeployed=true
Helper->>DB: Commit transaction
Helper-->>Route: {success, version, deployedAt}
Route->>Schedule: createSchedulesForDeploy(workflowId, blocks)
Schedule->>DB: Insert/update schedule records
Schedule-->>Route: Schedule result
Route-->>Admin: {isDeployed, version, deployedAt}
Note over Admin,Schedule: Undeploy Workflow Flow
Admin->>Route: DELETE /api/v1/admin/workflows/:id/deploy
Route->>DB: Check workflow exists
Route->>Helper: undeployWorkflow({workflowId})
Helper->>DB: Begin transaction
Helper->>Schedule: deleteSchedulesForWorkflow(workflowId)
Schedule->>DB: Delete all schedules
Helper->>DB: Deactivate all versions
Helper->>DB: Update workflow.isDeployed=false
Helper->>DB: Commit transaction
Helper-->>Route: {success}
Route-->>Admin: {isDeployed: false}
Note over Admin,Schedule: Activate Version Flow
Admin->>Route: POST /api/v1/admin/workflows/:id/versions/:vid/activate
Route->>DB: Check workflow exists
Route->>Helper: activateWorkflowVersion({workflowId, version})
Helper->>DB: Get version state
Helper->>DB: Begin transaction
Helper->>DB: Deactivate current active version
Helper->>DB: Activate specified version
Helper->>DB: Update workflow.deployedAt
Helper->>DB: Commit transaction
Helper-->>Route: {success, deployedAt, state}
Route-->>Admin: {success, version, deployedAt}
|
waleedlatif1
added a commit
that referenced
this pull request
Jan 3, 2026
…ext menu (#2672) * feat(logs-context-menu): consolidated logs utils and types, added logs record context menu (#2659) * feat(email): welcome email; improvement(emails): ui/ux (#2658) * feat(email): welcome email; improvement(emails): ui/ux * improvement(emails): links, accounts, preview * refactor(emails): file structure and wrapper components * added envvar for personal emails sent, added isHosted gate * fixed failing tests, added env mock * fix: removed comment --------- Co-authored-by: waleed <walif6@gmail.com> * fix(logging): hitl + trigger dev crash protection (#2664) * hitl gaps * deal with trigger worker crashes * cleanup import strcuture * feat(imap): added support for imap trigger (#2663) * feat(tools): added support for imap trigger * feat(imap): added parity, tested * ack PR comments * final cleanup * feat(i18n): update translations (#2665) Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com> * fix(grain): updated grain trigger to auto-establish trigger (#2666) Co-authored-by: aadamgough <adam@sim.ai> * feat(admin): routes to manage deployments (#2667) * feat(admin): routes to manage deployments * fix naming fo deployed by * feat(time-picker): added timepicker emcn component, added to playground, added searchable prop for dropdown, added more timezones for schedule, updated license and notice date (#2668) * feat(time-picker): added timepicker emcn component, added to playground, added searchable prop for dropdown, added more timezones for schedule, updated license and notice date * removed unused params, cleaned up redundant utils * improvement(invite): aligned styling (#2669) * improvement(invite): aligned with rest of app * fix(invite): error handling * fix: addressed comments --------- Co-authored-by: Emir Karabeg <78010029+emir-karabeg@users.noreply.github.com> Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com> Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com> Co-authored-by: Adam Gough <77861281+aadamgough@users.noreply.github.com> Co-authored-by: aadamgough <adam@sim.ai>
waleedlatif1
pushed a commit
that referenced
this pull request
Jan 8, 2026
* feat(admin): routes to manage deployments * fix naming fo deployed by
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.
Summary
Can deploy, undeploy, and activate specific workflows. Extracted into helpers to use between actual Sim platform and admin routes.
Type of Change
Testing
Tested manually curling admin routes
Checklist