Compiling Python Workflows Instead of Replaying Them
Waymark is an open-source durable execution library with a similar goal to Temporal and DBOS: allowing long-running processes to continue after a crash, machine restart, or task timeout.
Its distinguishing approach is to compile ordinary Python code into resumable tasks before execution rather than replaying the workflow from the beginning after a failure. The sections below examine its recovery model, Python interface, and use cases, as well as questions the available documentation leaves unanswered.
The project repository and README are available on GitHub.
How Compilation Differs from Replay
Replay is the common recovery mechanism in systems such as Temporal and DBOS.
These systems record the commands executed by a workflow. During recovery, they execute the same deterministic code path again, starting with the first command. Previously read inputs and historical return values are cached, while the framework skips or compensates for actual side effects.
This model is mature, but it comes with two constraints.
First, the code must satisfy replay requirements. Nondeterministic operations, including time, randomness, and external I/O, cannot be placed directly inside a workflow because recovery may produce different results.
Second, developers often need to use a workflow DSL or explicitly define which logic can be replayed and which logic constitutes a side effect.
Waymark takes a task-compilation approach. It compiles ordinary Python code into an executable task representation and saves intermediate state, external interactions, and recovery points. After a failure, the system resumes from the compiled task state without reinterpreting the original code path it has already traversed.
A rough distinction is:
- Replay: Keep the script. Perform it again while reusing as many previous results as possible.
- Compilation: Keep the program and machine state. Continue from the saved state after a failure.
This does not mean compilation eliminates every constraint. Dynamic execution in Python, captured closures, nonserializable objects, and side effects from third-party libraries can all affect what can be compiled. The current documentation does not provide enough evidence to show that it can handle arbitrary Python code.
Its design does, however, avoid the premise that an entire workflow must be deterministically replayable.
Workflows Written in Ordinary Python
Another of Waymark's selling points is that developers do not need to learn a dedicated DSL first. According to the project author, it supports regular Python business logic, including asyncio.gather, for loops, and conditional statements.
The general structure looks like this:
import asyncio
from waymark import Waymark
wm = Waymark()
async def fetch_customer(customer_id: str) -> dict:
return await wm.run(
f"fetch-customer:{customer_id}",
lambda: fetch_customer_record(customer_id),
)
async def summarize_order(order_id: str) -> str:
order = await fetch_order(order_id)
customer = await fetch_customer(order["customer_id"])
return await summarize(order, customer)
async def main() -> None:
results = await asyncio.gather(
summarize_order("order-123"),
summarize_order("order-456"),
)
print(results)
asyncio.run(main())
The key point is not the exact API naming, but that Python still expresses the control flow.
Parallel tasks can use asyncio.gather directly:
results = await asyncio.gather(
run_step("search-docs"),
run_step("query-db"),
run_step("call-model"),
)
Batch processing can still use a for loop:
for ticket_id in ticket_ids:
await process_ticket(ticket_id)
Branching does not require switching to a separate state-machine syntax either:
if order.total > 10_000:
await require_manual_review(order)
else:
await auto_approve(order)
Allowing ordinary code to enter workflows lowers the adoption barrier. Engineers can retain their existing function structure and then decide which calls need persistence, rather than first rewriting business logic in a framework-specific language.
This also distinguishes Waymark from many Agent orchestration frameworks. LangGraph explicitly models nodes, edges, and state. AutoGen and CrewAI organize workflows around message-based collaboration among multiple Agents. Waymark sits closer to execution infrastructure: its first concern is what happens after an interrupted task, not how to plan Agents.
Implications for AI Agent Workflows
A typical AI Agent task is rarely a single model call.
It may begin by reading documents, then break the work into subtasks, call search and business APIs, execute code, write to a database, and finally ask a model to generate a report. Any step may wait for tens of seconds, and external services may time out.
If the system tracks only whether the process is still running, its recovery capabilities remain fragile.
Waymark's compilation model focuses more heavily on durable execution state:
- Which steps have completed.
- Where each step's inputs and outputs are stored.
- Which external side effects have already occurred.
- Where execution should resume after an interruption.
This matters directly for long-running tasks. An Agent can wait for a slow code execution or approval result without depending on a continuously running local process. That is a foundational capability for background jobs lasting hours or days.
Durability should not be confused with improved Agent decision quality. Waymark does not make models plan better and cannot replace prompt evaluation, tool permissions, or output validation. It addresses execution reliability.
Calls to Claude, OpenAI, or other models still need to account for token consumption, rate limits, schema errors, and context changes. Even if Waymark can recover a workflow, it does not guarantee that model output after recovery will be identical to what it would have been before the interruption.
The more practical approach is to define model calls, database writes, payment requests, and similar boundaries as explicit durable steps, and to add idempotency keys to external systems. Otherwise, gaps can remain between recovered state and repeated side effects.
Choosing Among Waymark, Temporal, and DBOS
All three serve a similar purpose, but they make different trade-offs.
| Dimension | Waymark | Temporal | DBOS |
|---|---|---|---|
| Recovery model | Compiles tasks and saves task state | Replays deterministic workflows | Uses transactions and deterministic execution for recovery |
| Programming interface | Ordinary Python business logic | SDKs, workflow DSLs, activities, and queries | Python/TypeScript-style interfaces |
| Runtime complexity | The compiler and persistence layer still need evaluation | Standalone server with a relatively heavy component footprint | Relatively lightweight, but not free of runtime constraints |
| Ecosystem maturity | New project at the Show HN stage | Long-established with many production use cases | Relatively young, with some public deployments |
Teams that already rely heavily on Temporal would generally have no direct reason to migrate to Waymark. Temporal's server, visibility, task queues, versioning, and operational tooling form a complete system.
DBOS is better suited to teams that want to store workflow state in a transactional database without building a complex runtime themselves. Replay and determinism constraints still apply, however.
Waymark's appeal lies in its interface and recovery model. It aims to preserve familiar Python control flow while avoiding full replay. The cost is that there is not yet enough public evidence to judge:
- Whether it can reliably compile large, real-world projects.
- How compiled artifacts are versioned and kept compatible during upgrades.
- Which state-storage backends are available.
- How latency and throughput behave under high concurrency and long-running workloads.
- What its compatibility boundaries are for arbitrary third-party Python libraries.
At this stage, it is better suited to small-scale prototypes and architectural validation than to replacing production systems solely on the strength of its Show HN popularity.
Reaching Show HN After a Year of Development
Waymark was developed by its author and mozgiii. The author has said they worked on Waymark for nearly a year.
That timeline is consistent with the difficulty of the design. Task compilation is more than wrapping functions with logging. It requires identifying control flow, capturing dependencies, serializing state, and ensuring that execution can resume accurately after an interruption.
The project ultimately reached the Hacker News front page through a Show HN post. For infrastructure of this kind, Show HN is better understood as an invitation to discuss the design publicly, collect feedback, and find early users than as production validation.
Spending a year on the core mechanism reduces the risk of something that is merely a wrapper created in a few days. Nearly a year of development still cannot replace external benchmarks, fault-injection testing, or a record of long-term maintenance.
Editorial Perspective
Waymark matters not merely because it provides another Agent workflow framework. It targets a layer that is often underestimated when AI Agents move into production: how a workflow continues when model calls, code execution, or external API calls are interrupted.
In the near term, competitive differentiation will depend on more than whether recovery is supported. It will hinge on how much ordinary Python can be compiled. The more familiar the interface, the lower the migration cost; the more dynamic the business logic, the harder the boundaries for compilation and serialization become.
Its most concrete difference from earlier projects is that it puts the recovery model ahead of the programming interface. Temporal and DBOS have established relatively complete execution systems, while Waymark is attempting to change how continuation works at a more fundamental level. Public materials have not yet provided standardized benchmarks, fault-injection results, or production-scale data. Small-scale validation is currently more appropriate than direct replacement of a core system.