mech.app

The mech.app newsletter

Agentic AI, minus the noise.

Get practical field notes on AI agents, automation, developer tools and security delivered to your inbox.

No spam. Unsubscribe anytime.

AI Agents

Muxlio: Durable Workflow Orchestration for Multi-Step Agent Runs

How Muxlio persists agent state, resumes interrupted workflows, and handles partial completion across tool calls and LLM interactions.

Source: muxlio.github.io
Muxlio: Durable Workflow Orchestration for Multi-Step Agent Runs

Muxlio is a durable workflow coordinator that treats agent plans as immutable execution graphs and persists state across restarts, failures, and partial completions. It separates authoring (your assistant writes a workflow in TypeScript or JSON) from execution (the coordinator runs it as a durable run with SQLite-backed state). The architecture assumes multi-step work will fail partway through and needs resumption without re-running completed steps.

The Execution Model

Muxlio compiles workflows into immutable plan IR (intermediate representation) with a content digest. Once submitted, a run always executes the exact bytes that were validated. This prevents drift when an agent modifies the workflow mid-execution.

Core primitives:

  • Plan: Validated JSON with a content digest. Immutable after submission.
  • Run: One execution of a plan with inputs, state, attempts, logs, and artifacts. Persists until completion or pause.
  • Coordinator: Go service that schedules steps, stores SQLite state, and exposes HTTP API plus bundled UI (default port 7600). MCP listens separately when configured (default 7602).
  • Worker: Process that claims steps and runs adapters in an authorized workspace (local machine, remote host, or sandbox).
  • Adapter: Execution boundary for agent CLIs, remote A2A, shell commands, or other tools.

The coordinator does not execute steps directly. Workers poll for claimable steps, run adapters in isolated workspaces, and report results back. This separation lets you run workers on different hosts or inside sandboxes without exposing the coordinator’s state database.

State Persistence and Resume Logic

Muxlio persists intermediate state in SQLite after each step completes. When a run pauses (manual intervention, timeout, or crash), the coordinator can resume from the last committed step without replaying completed work.

How it handles partial completion:

  • Each step records its status: pending, running, completed, failed, or paused.
  • Artifacts (files, logs, tool outputs) are stored separately and referenced by digest.
  • If a worker crashes mid-step, the coordinator marks the step as failed after a timeout and can retry or pause the run.
  • Idempotency is not automatic. The workflow author must design steps to be safe for replay (e.g., check if a file exists before writing, use unique transaction IDs for external API calls).

Example workflow structure:

// Workflow authored by assistant or human
const featureWorkflow = {
  steps: [
    { id: "implement", adapter: "agent-cli", input: { task: "implement feature X" } },
    { id: "review", adapter: "agent-cli", input: { task: "review changes", depends: ["implement"] } },
    { id: "verify", adapter: "command", input: { cmd: "npm test" }, depends: ["review"] },
    { id: "fix", adapter: "agent-cli", input: { task: "fix test failures" }, runIf: "verify.failed", maxAttempts: 10 },
    { id: "commit", adapter: "command", input: { cmd: "git commit -m 'feature X'" }, depends: ["verify"] }
  ]
};

The coordinator compiles this into plan IR, validates dependencies, and schedules steps in topological order. If verify fails, it triggers fix up to 10 times before pausing the run.

Failure Modes and Recovery

Muxlio exposes primitives for timeouts, retries, and compensating transactions, but does not enforce idempotency or rollback semantics. You must design workflows to handle partial state.

Failure ScenarioCoordinator BehaviorRecovery Strategy
Worker crashes mid-stepMarks step as failed after timeoutRetry step or pause run for manual inspection
Tool call times outStep fails, run continues or pauses based on workflow configSet per-step timeout and max retry count
LLM returns malformed outputAdapter reports failure, step marked failedRetry with different prompt or pause for human review
Network partition during artifact uploadStep remains in “running” state until timeoutWorker re-uploads artifact on reconnect if idempotent
Partial file write before crashCoordinator has no visibility into file stateWorkflow must check file integrity before next step

Compensating transactions are not built-in. If step 5 fails and you need to undo steps 1-4, you must author explicit rollback steps in the workflow. The coordinator will execute them in order, but it does not track which steps need compensation.

Observability and Debugging

The bundled UI (port 7600) shows run state, step logs, and artifact links. The MCP integration (port 7602) lets you query run status and step history from your assistant.

What you can observe:

  • Step-by-step execution timeline with durations and retry counts.
  • Artifact storage with content-addressable links (files, logs, tool outputs).
  • Worker assignment and workspace metadata (host, sandbox ID, environment manifest).
  • Pause reasons (manual, timeout, max retries exceeded, dependency failure).

What you cannot observe:

  • Internal LLM reasoning or tool call traces (those live in the adapter, not the coordinator).
  • Real-time step progress (workers report results after completion, not during execution).
  • Resource usage per step (CPU, memory, network) unless the adapter logs it.

Deployment Shape

Muxlio runs as a single Go binary with embedded SQLite. You can deploy it on a local machine, remote server, or container. Workers run separately and connect to the coordinator over HTTP.

Typical setup:

  1. Start coordinator: muxlio serve --port 7600 --mcp-port 7602
  2. Start worker on same host: muxlio worker --coordinator http://localhost:7600
  3. Start worker in Docker sandbox: muxlio worker --coordinator http://coordinator:7600 --adapter docker-sandbox

The coordinator does not scale horizontally (single SQLite file). If you need distributed execution, run multiple workers but keep one coordinator instance. For high availability, you would need to implement SQLite replication or switch to a different state backend (not currently supported).

Security Boundaries

Workers run adapters in isolated workspaces with environment manifests that declare allowed tools, network access, and file paths. The coordinator does not enforce sandboxing. You must configure workers to use Docker, Firecracker, or other isolation mechanisms.

Trust model:

  • The coordinator trusts workers to report accurate step results.
  • Workers trust the coordinator to provide valid plan IR and artifact references.
  • Adapters trust the workspace environment to be correctly configured.

If a worker is compromised, it can report false step results or exfiltrate artifacts. If the coordinator is compromised, it can modify run state or inject malicious steps. Muxlio does not provide cryptographic verification of step results or plan integrity beyond content digests.

When to Use Muxlio

Good fit:

  • Multi-step agent workflows with verification, retries, or hand-offs (e.g., implement → review → test → fix → commit).
  • Long-running tasks that need to survive restarts or network failures.
  • Workflows where you want to inspect partial state before continuing.
  • Scenarios where you need to replay failed steps without re-running the entire workflow.

Poor fit:

  • Single-shot agent queries (use a client library instead).
  • Workflows that require distributed transactions or strict ACID guarantees (Muxlio uses SQLite with no distributed coordination).
  • Real-time streaming execution (workers report results after step completion).
  • Workflows that need automatic rollback or compensation (you must author explicit rollback steps).

Technical Verdict

Muxlio solves the durable execution problem for agent workflows by persisting state in SQLite and separating orchestration from execution. It works well when you need to resume interrupted multi-step work and can tolerate eventual consistency. The immutable plan model prevents drift, but you must design workflows to be idempotent and handle partial state explicitly. Security depends entirely on worker isolation, which Muxlio does not enforce. If you need distributed coordination, automatic rollback, or cryptographic verification, look elsewhere. If you need a lightweight coordinator that persists agent state and lets you inspect runs in a UI, Muxlio fits.