Skip to main content

Crate machi_workflow

Crate machi_workflow 

Source
Expand description

Deterministic workflow orchestration engine.

Scripts never call LLMs. They issue WorkflowHostRequest values over a channel; a product host executes nested agents and replies. Results are recorded in a Journal for resume.

Dependency firewall: this crate must not depend on machi-llm or HTTP provider stacks.

Maturity: core.

Re-exports§

pub use engine::WorkflowRunParams;
pub use engine::run_workflow;
pub use host::AgentOpts;
pub use host::AgentResult;
pub use host::BudgetState;
pub use host::HostError;
pub use host::WorkflowHostRequest;
pub use journal::HOST_ERROR_KEY;
pub use journal::JOURNAL_VERSION_HEADER;
pub use journal::Journal;
pub use journal::JournalEntry;
pub use journal::JournalError;
pub use journal::MAX_JOURNAL_BYTES;
pub use journal::MAX_JOURNAL_ENTRIES;
pub use journal::canonical_json;
pub use journal::host_error_message;
pub use journal::host_error_sentinel;
pub use journal::is_host_error_sentinel;
pub use journal::request_hash;
pub use meta::MetaError;
pub use meta::WorkflowMeta;
pub use meta::extract_meta;
pub use run::PauseKind;
pub use run::WorkflowOutcome;
pub use store::FileWorkflowRunStore;
pub use store::MemoryWorkflowRunStore;
pub use store::StoreError;
pub use store::WorkflowRunRecord;
pub use store::WorkflowRunStatus;
pub use store::WorkflowRunStore;
pub use validate::ValidationError;
pub use validate::ValidationReport;
pub use validate::default_probe_args;
pub use validate::validate_script;
pub use validate::validate_script_with_agent_budget;

Modules§

engine
Rhai workflow engine with journaled host calls.
host
Host request protocol (side-effect boundary).
journal
Append-only host-call journal for resume (format v2).
meta
Workflow metadata extraction from scripts.
run
Workflow outcomes.
store
Workflow run metadata store (journal path + status — not UI).
validate
Dry-run validation of workflow scripts (meta + stub host path).

Constants§

DEFAULT_AGENT_BUDGET
Default cumulative agent-call budget.
MAX_AGENT_BUDGET
Hard ceiling for agent budget.
MAX_HOST_CALLS
Max result-bearing host calls per run.
MAX_PARALLEL
Max items in one parallel() panel.