Fork Recovery
Fork recovery lets you take a failed (or completed) run, read the exact YAML that executed, and create a new draft workflow from it. You iterate on the draft, fix the issue, and run again --- all without modifying the original workflow or losing the run history.
When to fork
Section titled “When to fork”Fork is the primary recovery path when a run fails. Instead of editing the live workflow and hoping you remember what changed, forking gives you:
- The exact YAML snapshot from the failed run’s
commit_sha. - A new draft workflow that is independent of the original.
- The original run history and the original workflow remain untouched.
How to fork a run
Section titled “How to fork a run”From the GUI
Section titled “From the GUI”- Open any completed or failed run from the Runs page.
- The run detail view is read-only --- you cannot edit the YAML directly.
- Click the Fork button in the topbar header.
- Runsight creates a new draft workflow named
drft-{slug}-{short-id}(e.g.,drft-research-pipeline-a3f1). - The editor opens the new draft, ready for you to modify and re-run.
What happens under the hood
Section titled “What happens under the hood”- The frontend reads the workflow YAML at the run’s commit SHA via
GET /api/git/file?ref={commit_sha}&path=custom/workflows/{workflow_id}.yaml. - It parses the YAML and sets
enabled: falseso the draft does not appear as a live workflow. - It calls
POST /api/workflowswithcommit: falseto create the draft without auto-committing it. The draft appears as an uncommitted workflow. - The browser navigates to the new draft in edit mode.
No dedicated fork endpoint exists on the backend. The fork flow is composed entirely from existing primitives: git file read, workflow creation, and navigation.
From the API
Section titled “From the API”You can replicate the fork flow manually:
curl "http://localhost:8321/api/git/file?ref=abc1234&path=custom/workflows/research-pipeline.yaml"curl -X POST http://localhost:8321/api/workflows \ -H "Content-Type: application/json" \ -d '{ "name": "drft-research-pipeline-x9k2", "yaml": "... modified YAML ...", "commit": false }'Fork naming convention
Section titled “Fork naming convention”Forked drafts follow the pattern:
drft-{slugified-workflow-name}-{4-char-random}The slug is lowercase, non-alphanumeric characters replaced with hyphens, consecutive hyphens collapsed. The random suffix uses a 4-character alphanumeric string from Math.random().toString(36).
Examples:
drft-research-pipeline-a3f1drft-customer-onboarding-zk92
The drft- prefix signals that this workflow is a draft fork, not a production workflow.
Priority banner
Section titled “Priority banner”The canvas uses a PriorityBanner component to surface contextual alerts. The banner supports three condition types in priority order:
- explore --- informational banner (info styling, dismissible with localStorage persistence).
- uncommitted --- warning banner when the workflow has unsaved changes (warning styling, session-scoped dismiss).
- regressions --- warning banner when eval regressions are detected (warning styling, session-scoped dismiss).
Only the highest-priority active banner is shown at a time. If you dismiss the top-priority banner, lower-priority banners do not cascade into view --- the dismiss is sticky for that session.
Fork recovery workflow
Section titled “Fork recovery workflow”The typical fork recovery loop:
- A production run fails on the main branch.
- You open the failed run from the Runs page.
- You review the run detail --- block outputs, errors, eval results --- in read-only mode.
- You click Fork to create a draft from the exact YAML that failed.
- You edit the draft to fix the issue (adjust prompts, change transitions, modify limits).
- You run the draft as a simulation run (since it has uncommitted changes).
- If the simulation succeeds, you save the draft (commit to main) or copy the changes back to the original workflow.
This preserves the full audit trail: the original run, the fork point, and the iteration history are all distinct records.