feat: Workflow execution snapshotting for safe live editing#339
Draft
geoffwellman wants to merge 2 commits intouseplunk:nextfrom
Draft
feat: Workflow execution snapshotting for safe live editing#339geoffwellman wants to merge 2 commits intouseplunk:nextfrom
geoffwellman wants to merge 2 commits intouseplunk:nextfrom
Conversation
Freeze the workflow graph (steps, transitions, template content) into a JSON snapshot on each execution at start time. The execution engine reads from this snapshot instead of the live DB, so in-flight contacts are completely isolated from workflow edits. - Add workflowSnapshot Json field to WorkflowExecution - Add WorkflowSnapshot types and buildWorkflowSnapshot/resolveWorkflowGraph helpers - Rewire WorkflowExecutionService to resolve graph from snapshot with legacy fallback - Implement soft-delete for WorkflowStep (deletedAt field) - Change StepExecution.stepId and Execution.currentStepId to SetNull on delete - Remove active-execution edit restrictions from WorkflowService - Add 7 snapshot isolation tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace restrictive edit-lock banner with informational message
("N contacts in workflow, changes only affect new executions")
- Add execution count badges on workflow nodes showing active
contacts per step via new step-execution-counts API endpoint
- Fix position persistence: save node positions to DB on drag stop
and skip dagre auto-layout for nodes with saved positions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
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
What this enables
Users can now edit step configs, add/remove/reorder steps, change templates, and rewire transitions on live workflows without affecting contacts already in-flight. Each execution runs the version of the workflow it started with.
Changes
Backend:
workflowSnapshot Json?field onWorkflowExecution— stores frozen graph at execution startWorkflowSnapshottypes +buildWorkflowSnapshot()/resolveWorkflowGraph()helpersWorkflowExecutionServicerewired to resolve graph from snapshot (with legacy fallback for pre-existing executions)WorkflowStep.deletedAtfor soft-delete,SetNullon step execution FKsWorkflowService(update, updateStep, deleteStep, deleteTransition)GET /workflows/:id/step-execution-countsendpointFrontend:
Test plan
🤖 Generated with Claude Code