What Are Executions?
Executions are multi-step workflows with dependency ordering managed by a DAG (directed acyclic graph). Each execution:- Contains 2+ related steps (tasks)
- Tracks dependencies between steps (“B needs A to finish first”)
- Enables parallel execution where dependencies allow
- Supports pausing/resuming at checkpoints
- Cascades cancellation through dependent steps
Creating Executions
The coordinator agent creates executions usingenki_execution_create:
scaffold completes and merges:
email_provider and sms_provider run in parallel. When both complete, tests becomes ready.
Dependency Conditions
By default, steps wait for dependencies to merge (branch lands on main). You can relax this with edge conditions:Merged (Default)
Completed
Started
Checkpoint Steps
Checkpoint steps pause the execution after completion for review and decision-making:- Worker completes and produces output (artifact or branch summary)
- Merge lands (if it’s a code-producing worker)
- Execution pauses—no new steps start, even if ready
-
Coordinator notified with the step’s output:
- You review findings and decide next actions
-
Add steps (if needed) with
enki_execution_add_steps: -
Resume with
enki_resumeto continue execution:
Use Cases for Checkpoints
- Investigation-driven development: Research first, implement based on findings
- Phased rollouts: Deploy phase 1, validate, then add phase 2 steps
- Prototype approval: Build POC, get user approval, then implement production version
- Exploratory debugging: Diagnose issue, confirm root cause, then fix
Pausing and Resuming
Pause an execution to temporarily halt progress:- Does NOT kill running workers (they continue until completion)
- Prevents new steps from starting
- Puts pending/ready steps into
pausedstate
Pausing does not affect currently running workers—it only prevents future steps from starting. To stop running workers, use cancellation.
Canceling Tasks
Cancel a step or entire execution to stop work and mark it as cancelled:- Kills running workers for steps in this execution
- Marks all pending/ready/running steps as
cancelled - Cascades to dependents: Any steps depending on cancelled steps are also cancelled
- Marks the execution as
failed(no longer progressing)
Pause vs. Cancel
| Pause | Cancel | |
|---|---|---|
| Running workers | Continue until completion | Killed immediately |
| Pending/ready steps | Can resume later | Marked cancelled (permanent) |
| Cascades to dependents | No | Yes |
| Execution status | Paused (temporary) | Failed (terminal) |
Retry Behavior
Automatic Retries
Certain failure types trigger automatic retries (up to 2 additional attempts):- Timeouts: Worker exceeded stale threshold (120s for standard tier)
- No changes: Worker completed but made no file modifications (likely stuck or confused)
ready and spawns a fresh worker.
Manual Retry
For permanent failures (after exhausting auto-retries or other error types), useenki_task_retry:
- Resets the task to
readystatus - Unblocks any sibling tasks that were blocked by this failure
- Restores the execution (if it was marked failed due to this task)
- Spawns a new worker when the scheduler ticks
Retry Budget
Each task has a retry counter. After 3 total failures (including auto-retries), the task is marked as blocked and requires manual intervention:- Read the full session log at
~/.enki/logs/sessions/<label>.log - Identify the root cause (missing context, unclear description, codebase issue)
- Fix the underlying problem (adjust the task description, provide more context, fix broken code)
- Use
enki_task_retryto add another attempt
Viewing Execution Status
Ask the coordinator for status updates:enki_task_list and show:
- Execution ID
- Steps and their current status (pending, running, done, failed, paused, cancelled)
- Which workers are active
- Recent events (completions, merges, failures)
enki_status for counts by status:
enki_task_list for details.
Execution Lifecycle
Adding Steps to Running Executions
Useenki_execution_add_steps to extend an execution dynamically:
- Can depend on existing steps (reference by step ID)
- Can depend on other new steps being added in the same call
- Follow normal dependency resolution (pending → ready → running)
Stopping All Workers
To immediately halt all running workers across all executions:enki_stop_all, which:
- Kills all active worker sessions
- Does NOT mark tasks as cancelled (they remain in their current state)
- Useful for emergency stops or when you need to reconfigure something
Best Practices
Use executions for multi-step work
Use executions for multi-step work
Even for just 2 related tasks, prefer an execution over standalone tasks. You get:
- Dependency tracking
- Progress visibility
- Ability to add steps later
- Checkpoint support
Design for parallelism
Design for parallelism
Break work into steps that can run simultaneously:All three features run in parallel after the scaffold. This is faster than sequential work.
Use checkpoints for uncertainty
Use checkpoints for uncertainty
If you don’t know the full plan upfront (research-driven work, exploratory debugging), use checkpoints:
Retry with context
Retry with context
When a task fails, the coordinator reads the session log excerpt automatically. Always:
- Review the diagnosis
- Check if the task description was clear enough
- Add context if needed before retrying
Cancel failed branches early
Cancel failed branches early
If a critical step fails and you need to pivot:
- Cancel the execution (stops dependent work)
- Create a new execution with the corrected plan
