Skip to main content

rust_viewflow/
lib.rs

1pub mod api;
2/// Rust Viewflow - A workflow library inspired by Viewflow, compatible with Axum and Actix-web
3///
4/// This library provides a flexible workflow engine that can be integrated with different web frameworks
5/// and database backends. It includes a sample leave request workflow to demonstrate usage.
6pub mod core;
7pub mod db;
8
9pub use api::{
10    ApiResponse, CompleteTaskRequest, CreateWorkflowRequest, DefaultWorkflowApi, WorkflowApi,
11};
12pub use core::engine::DefaultWorkflowEngine;
13pub use core::workflows::leave_request::LeaveRequestWorkflow;
14/// Re-export core types for easier access
15pub use core::{
16    TaskState, TaskStatus, WorkflowDefinition, WorkflowEngine, WorkflowResult, WorkflowState,
17    WorkflowStatus,
18};
19pub use db::{migrate_mysql, migrate_postgres, migrate_sqlite};
20pub use db::{MemoryDatabase, MySqlDatabase, PostgresDatabase, SqliteDatabase, WorkflowDatabase};
21
22#[cfg(feature = "axum")]
23pub use api::axum::create_router as create_axum_router;
24
25#[cfg(feature = "actix")]
26pub use api::actix::workflow_scope as create_actix_scope;
27
28/// Version of the library
29pub const VERSION: &str = env!("CARGO_PKG_VERSION");