nexo-taskflow
Durable multi-step workflow runtime for Nexo —
Flowstate machine + SQLite-backedFlowStore+WaitEnginetick loop +taskflow_toolLLM-facing API. Survives restarts; reanudates timer-based + external-event waits.
This crate is part of Nexo — a multi-agent Rust framework with a NATS event bus, pluggable LLM providers (MiniMax, Anthropic, OpenAI-compat, Gemini, DeepSeek), per-agent credentials, MCP support, and channel plugins for WhatsApp, Telegram, Email, and Browser (CDP).
- Main repo: https://github.com/lordmacu/nexo-rs
- Runtime engine:
nexo-core - Public docs: https://lordmacu.github.io/nexo-rs/
What this crate does
Flowstate machine —Created → Running → Waiting → Resumed → Finished | Failed | Cancelled. Transitions validated; can_transition_to() refuses illegal moves.FlowStoretrait + SQLite impl — every transition writes through; restart re-loads the open set (Running + Waiting).WaitCondition—Timer { at },ExternalEvent { topic, correlation_id },Manual { signal }. Each is serialised into the DB so the engine can resume without losing the wait spec.WaitEnginetick loop — runs as a single global tokio task; every interval scansWaitingflows, fires due timers, and reanudates them. Sub-millisecond tick-no-due (bench-covered).- NATS resume bridge — subscribes the topics every
ExternalEventwait declared; on event arrival, looks up the matching flow bycorrelation_idand reanudates. - Mirrored mode —
MirroredFlowlets the host record externally-driven steps (e.g. a webhook poller produced an event) without owning the flow lifecycle. taskflow_tool— LLM-facing tool with actionsstart,status,advance,wait,finish,fail,cancel,list_mine. Per-binding capability gate + timer max horizon guardrail (timer_max_horizon).
Public API
When to use
- Agent has to wait days for an external signal (payment received, approval given, document uploaded).
- Multi-step workflow that must survive daemon restart with cursor preserved.
- Periodic recurring task with state (rolling N-day reminder).
- Long-running batch process with checkpointing.
Install
[]
= "0.1"
Documentation for this crate
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.