AbstractRuntime: a durable graph runner designed to pair with AbstractCore.
Project description
AbstractRuntime
AbstractRuntime is a durable workflow runtime (interrupt → checkpoint → resume) with an append-only execution ledger.
It is designed for long-running workflows that must survive restarts and explicitly model blocking (human input, timers, external events, subworkflows) without keeping Python stacks alive.
Version: 0.4.1 (pyproject.toml) • Python: 3.10+
Install
Core runtime:
pip install abstractruntime
AbstractCore integration (LLM + tools):
pip install "abstractruntime[abstractcore]"
MCP worker entrypoint (default toolsets over stdio):
pip install "abstractruntime[mcp-worker]"
Quick start (pause + resume)
from abstractruntime import Effect, EffectType, Runtime, StepPlan, WorkflowSpec
from abstractruntime.storage import InMemoryLedgerStore, InMemoryRunStore
def ask(run, ctx):
return StepPlan(
node_id="ask",
effect=Effect(
type=EffectType.ASK_USER,
payload={"prompt": "Continue?"},
result_key="user_answer",
),
next_node="done",
)
def done(run, ctx):
return StepPlan(node_id="done", complete_output={"answer": run.vars.get("user_answer")})
wf = WorkflowSpec(workflow_id="demo", entry_node="ask", nodes={"ask": ask, "done": done})
rt = Runtime(run_store=InMemoryRunStore(), ledger_store=InMemoryLedgerStore())
run_id = rt.start(workflow=wf)
state = rt.tick(workflow=wf, run_id=run_id)
assert state.status.value == "waiting"
state = rt.resume(
workflow=wf,
run_id=run_id,
wait_key=state.waiting.wait_key,
payload={"text": "yes"},
)
assert state.status.value == "completed"
What’s included (v0.4.1)
Kernel (dependency-light):
- workflow graphs:
WorkflowSpec(src/abstractruntime/core/spec.py) - durable execution:
Runtime.start/tick/resume(src/abstractruntime/core/runtime.py) - durable waits/events:
WAIT_EVENT,WAIT_UNTIL,ASK_USER,EMIT_EVENT - append-only ledger (
StepRecord) + node traces (vars["_runtime"]["node_traces"]) - retries/idempotency hooks:
src/abstractruntime/core/policy.py
Durability + storage:
- stores: in-memory, JSON/JSONL, SQLite (
src/abstractruntime/storage/*) - artifacts + offloading (store large payloads by reference)
- snapshots/bookmarks (
docs/snapshots.md) - tamper-evident hash-chained ledger (
docs/provenance.md)
Drivers + distribution:
- scheduler:
create_scheduled_runtime()(src/abstractruntime/scheduler/*) - VisualFlow compiler + WorkflowBundles (
src/abstractruntime/visualflow_compiler/*,src/abstractruntime/workflow_bundle/*) - run history export:
export_run_history_bundle(...)(src/abstractruntime/history_bundle.py)
Optional integrations:
- AbstractCore (LLM + tools):
docs/integrations/abstractcore.md - comms toolset gating (email/WhatsApp/Telegram):
docs/tools-comms.md
Built-in scheduler (zero-config)
from abstractruntime import create_scheduled_runtime
sr = create_scheduled_runtime()
run_id, state = sr.run(my_workflow)
if state.status.value == "waiting":
state = sr.respond(run_id, {"answer": "yes"})
sr.stop()
For persistent storage:
from abstractruntime import create_scheduled_runtime, JsonFileRunStore, JsonlLedgerStore
sr = create_scheduled_runtime(
run_store=JsonFileRunStore("./data"),
ledger_store=JsonlLedgerStore("./data"),
)
Documentation
| Document | Description |
|---|---|
| Getting Started | Install + first durable workflow |
| API Reference | Public API surface (imports + pointers) |
| Docs Index | Full docs map (guides + reference) |
| FAQ | Common questions and gotchas |
| Architecture | Component map + diagrams |
| Overview | Design goals, core concepts, and scope |
| Integrations | Integration guides (AbstractCore) |
| Snapshots | Named checkpoints for run state |
| Provenance | Tamper-evident ledger documentation |
| Evidence | Artifact-backed evidence capture for web/command tools |
| Limits | _limits namespace and RuntimeConfig |
| WorkflowBundles | .flow bundle format (VisualFlow distribution) |
| MCP Worker | abstractruntime-mcp-worker CLI |
| Changelog | Release notes |
| Contributing | How to build/test and submit changes |
| Security | Responsible vulnerability reporting |
| Acknowledgments | Credits |
| ROADMAP | Prioritized next steps |
Development
python -m venv .venv
source .venv/bin/activate
python -m pip install -U pip
python -m pip install -e ".[abstractcore,mcp-worker]"
python -m pytest -q
See CONTRIBUTING.md for contribution guidelines and doc conventions.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file abstractruntime-0.4.2.tar.gz.
File metadata
- Download URL: abstractruntime-0.4.2.tar.gz
- Upload date:
- Size: 451.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cea45c569bca570eeaf6ecfe6275fbd953632795fd9df008cd4a7f4ce0bafd7b
|
|
| MD5 |
b24f02dea63b6d25c0746c2b23a98c3a
|
|
| BLAKE2b-256 |
70d2f26b81885db94d41208ef0302a23ef763c178b15f390ffd8c441fbc7166f
|
File details
Details for the file abstractruntime-0.4.2-py3-none-any.whl.
File metadata
- Download URL: abstractruntime-0.4.2-py3-none-any.whl
- Upload date:
- Size: 328.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fd69d914e1b3914468dd9b6a4a426fd131310f015e1a9dacb18c1e0cba5c7fc
|
|
| MD5 |
05b9791f3a35581ab94f54a1f4a37d58
|
|
| BLAKE2b-256 |
f18bd6e6fd9fbe1b051b19edd73d3619cb825f71cbe02f41b3e7b06e4e63d728
|