1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
//! # `Blazen`
//!
//! A high-performance, event-driven workflow framework for Rust.
//!
//! `Blazen` models computation as a directed graph of *steps* connected by
//! typed *events*. The runtime maintains an internal event queue, routing
//! events to matching step handlers and spawning them concurrently until a
//! [`StopEvent`] terminates the workflow.
//!
//! ## Quick start
//!
//! ```rust,ignore
//! use blazen::prelude::*;
//!
//! #[derive(Debug, Clone, Serialize, Deserialize, Event)]
//! struct GreetEvent { name: String }
//!
//! #[step]
//! async fn greet(event: StartEvent, _ctx: Context) -> Result<StopEvent, WorkflowError> {
//! let name = event.data["name"].as_str().unwrap_or("World");
//! Ok(StopEvent { result: serde_json::json!({ "greeting": format!("Hello, {}!", name) }) })
//! }
//!
//! #[tokio::main]
//! async fn main() -> anyhow::Result<()> {
//! let workflow = WorkflowBuilder::new("greeter")
//! .step(greet_registration())
//! .build()?;
//! let result = workflow.run(serde_json::json!({ "name": "Zach" })).await?.result().await?.event;
//! println!("{}", result.to_json());
//! Ok(())
//! }
//! ```
//!
//! ## Feature flags
//!
//! | Feature | Description |
//! |---------|-------------|
//! | `llm` (default) | LLM provider integrations |
//! | `openai` | OpenAI + OpenAI-compatible providers |
//! | `anthropic` | Anthropic Claude provider |
//! | `persist` | Checkpoint storage via `redb` |
//! | `telemetry` | Observability, tracing spans, and workflow history |
//! | `all` | Everything |
// ---------------------------------------------------------------------------
// Core re-exports
// ---------------------------------------------------------------------------
// Events: traits and built-in types.
pub use ;
// Macros: derive and attribute macros.
pub use ;
// Core: workflow engine types.
pub use ;
// Serde: needed by derive(Event) expansion and examples.
pub use serde;
pub use serde_json;
// ---------------------------------------------------------------------------
// Optional modules
// ---------------------------------------------------------------------------
/// LLM provider integrations (requires `llm` feature).
/// Checkpoint persistence (requires `persist` feature).
// Top-level re-exports of key persist types for convenience.
pub use ;
/// Multi-workflow pipeline orchestration (requires `pipeline` feature).
/// Prompt template management (requires `prompts` feature).
/// Observability and telemetry (requires `telemetry` feature).
pub use blazen_telemetry as telemetry;
// ---------------------------------------------------------------------------
// Prelude
// ---------------------------------------------------------------------------
/// Convenient wildcard import for common types and traits.
///
/// ```rust,ignore
/// use blazen::prelude::*;
/// ```