What are Workflows?
Workflows in sudocode allow you to execute linked issues, specs, or sets of issues in dependency order. Instead of manually dispatching agents one issue at a time, workflows automatically process dependency chains. Manual execution:- Dispatch agent for issue 1
- Wait for completion
- Dispatch agent for issue 2
- Wait for completion
- Repeat for each dependent issue
- Select the final issue in a dependency chain
- Start workflow
- sudocode automatically processes all blocking issues in topological order
- Agents work in parallel where possible
- Review and merge results when complete
Example: Bug Fix with TDD Workflow
Let’s walk through fixing a modal bug using a test-driven development approach with workflows. This example demonstrates how to break down a bug into testable issues, establish dependencies, and execute them as a coordinated workflow.The Bug
When opening a submodal within an issue modal, pressing “Esc” collapses both modals and stops execution. The bug only occurs with the Esc key, not when clicking outside the modal.Phase 1: Planning the Fix with an Agent
Step 1: Describe the bug and ask the agent to create issues
localhost:3000 and navigate to the Issues board:
- Review all 4 issues created by the agent
- Verify the dependency chain is correct
- Modify issue descriptions if needed
If you want to save the state of your issues board, you can commit the changes to your git repository:
Phase 2: Execute the Workflow
Step 5: Start the workflow
- Navigate to the workflow board at
localhost:3000 - Select “From Root Issue” and select the final issue in the chain (
i-valid1) - Click the “Start Workflow” button
- sudocode automatically identifies all blocking dependencies and creates an execution plan

- The first issue (i-test1) starts immediately since it has no blockers
- Subsequent issues automatically start when their blockers complete
- Each issue runs in the same isolated worktree
- Progress updates appear in real-time on the issue board

- Current execution status
- Agent conversation and decision-making
- Files being modified
- Test results and validation

- View all modified files
- See diffs of changes made
- Review test results
- Stop the agent, and chat with it directly
Phase 3: Merge Results
Step 9: Merge worktree changes
- Review the changes made across all issues
- Click “Merge Worktree” to integrate changes into your main branch
- sudocode merges all commits from the worktree into your main branch
Benefits of Workflows
Automated Coordination
No manual orchestration needed
- sudocode handles execution order
- Parallel work runs concurrently
- Dependencies respected automatically
- Hands-off execution
Isolated Execution
Safe, conflict-free processing
- Each issue in separate worktree
- No interference between agents
- Easy rollback per issue
- Clean merge points
Visibility
Track progress in real-time
- See all issues in workflow
- Monitor agent decisions
- Review files as they’re modified
- Understand implementation choices
When to Use Workflows
Workflows are ideal for:- Multi-step bug fixes: Test writing, implementation, validation
- Feature development: Database → domain → API → testing phases
- Refactoring projects: Multiple coordinated code changes
- Migration tasks: Sequential steps with clear dependencies
- Single, standalone issues with no dependencies
- Exploratory work without clear structure
- Tasks requiring frequent human decision-making
Best Practices
Structure work with clear dependencies
Structure work with clear dependencies
Break complex tasks into small, focused issues with explicit dependencies.Good structure:Poor structure:Clear dependencies enable workflows to automatically determine the correct execution order.
Start workflows from the final issue
Start workflows from the final issue
When starting a workflow, select the last issue in the dependency chain. sudocode will automatically identify and execute all blocking dependencies.Why this works:
- The workflow engine traces backwards through
blocksrelationships - All necessary work is discovered automatically
- You don’t need to manually select each issue
- Ensures nothing is missed
Review before merging
Review before merging
Always review worktree changes before merging into your main branch.What to check:
- Implementation matches issue requirements
- Tests are passing
- No unintended side effects
- Code quality meets standards
- Agent decisions make sense
Troubleshooting
Merge conflicts in issues.jsonl or specs.jsonl
Merge conflicts in issues.jsonl or specs.jsonl
Cause: Multiple worktrees modified the same issues or specsSolution:The
resolve-conflicts command automatically handles concurrent modifications to sudocode metadata files.Workflow stuck: Issue not progressing
Workflow stuck: Issue not progressing
Cause: Agent encountered an error or needs human inputSolution:
- Click on the stuck issue to view details
- Review the agent conversation to identify the blocker
- If the agent needs clarification, provide it in the issue chat
- If the agent errored, you can restart the issue or manually fix and continue
Want to cancel a running workflow
Want to cancel a running workflow
Cause: Need to stop execution due to errors or changed requirementsSolution:
- Navigate to the workflow view
- Click “Cancel Workflow” or cancel individual issues
- Review any completed work in their worktrees
- Delete worktrees for cancelled issues or merge partial work if useful

