Crate actflow

Crate actflow 

Source
Expand description

§Actflow

Actflow is a lightweight, event-driven workflow engine written in Rust. It is designed to be embedded in applications to orchestrate complex business logic.

§Core Features

  • Event-Driven Architecture: Built on a robust event bus for high decoupling and scalability
  • Async Execution: Powered by tokio for high-concurrency workflow execution
  • Pluggable Storage: Supports in-memory storage (testing) and PostgreSQL (production)
  • Flexible Workflow Definition: Define workflows using JSON with various node types

§Quick Start

use actflow::{EngineBuilder, WorkflowModel};

let engine = EngineBuilder::new().build().unwrap();
engine.launch();

// Deploy and run workflow
let workflow = WorkflowModel::from_json(json_str)?;
engine.deploy(&workflow)?;
let process = engine.build_process(&workflow.id)?;
engine.run_process(process)?;

Structs§

ChannelEvent
Builder for registering event handlers with filtering.
ChannelOptions
Options for filtering events by process ID and node ID.
EdgeModel
Represents a directed edge connecting two nodes in a workflow.
Engine
The main workflow engine.
EngineBuilder
Event
Generic event wrapper.
Log
Log entry emitted during node execution.
Message
Event message containing process and node context.
NodeModel
Represents a node in a workflow definition.
WorkflowAbortedEvent
Event emitted when a workflow is aborted.
WorkflowFailedEvent
Event emitted when a workflow fails.
WorkflowModel
Represents a complete workflow definition.
WorkflowPausedEvent
Event emitted when a workflow is paused.
WorkflowStartEvent
Event emitted when a workflow starts.

Enums§

ActflowError
Unified error type for all Actflow operations.
ErrorReason
Reason for a node execution error.
GraphEvent
Top-level event type for workflow graph events.
NodeEvent
Events emitted during node execution.
WorkflowEvent
Events emitted during workflow execution.

Type Aliases§

Result
Result type alias for Actflow operations.