aion_core/lib.rs
1//! Pure domain model and shared vocabulary for Aion durable workflows.
2//!
3//! This leaf crate defines the stable identifiers, payload carrier, history events,
4//! workflow filters, schedule settings, search attributes, statuses, and error
5//! taxonomy used by every other Aion component.
6//!
7//! # Example
8//!
9//! ```
10//! use aion_core::{Payload, WorkflowId};
11//! use serde_json::json;
12//!
13//! let workflow_id = WorkflowId::new_v4();
14//! let payload = Payload::from_json(&json!({ "workflow_id": workflow_id.to_string() }))?;
15//! assert_eq!(payload.to_json()?["workflow_id"], workflow_id.to_string());
16//! # Ok::<(), Box<dyn std::error::Error>>(())
17//! ```
18
19/// Error types shared by workflow engines, callers, and activities.
20pub mod error;
21/// Durable workflow history events and envelopes.
22pub mod event;
23/// Workflow visibility filters and summaries.
24pub mod filter;
25#[cfg(test)]
26mod generated_types;
27/// Strongly typed identifiers for workflows, runs, activities, timers, and schedules.
28pub mod ids;
29/// Type-erased payload bytes with explicit content-type metadata.
30pub mod payload;
31/// Schedule configuration, trigger, and catch-up policy models.
32pub mod schedule;
33/// Search-attribute schemas and values used by visibility queries.
34pub mod search;
35/// Workflow lifecycle status derivation.
36pub mod status;
37
38pub use error::{ActivityError, ActivityErrorKind, WorkflowError};
39pub use event::{Event, EventEnvelope, WithTimeoutOutcome};
40pub use filter::{WorkflowFilter, WorkflowSummary};
41pub use ids::{ActivityId, IdError, PackageVersion, RunId, TimerId, WorkflowId};
42pub use payload::{ContentType, Payload, PayloadError};
43pub use schedule::{CatchUpPolicy, OverlapPolicy, ScheduleConfig, ScheduleId, TriggerSpec};
44pub use search::{
45 SearchAttributeError, SearchAttributeSchema, SearchAttributeType, SearchAttributeValue,
46 search_attributes_from_events,
47};
48pub use status::{WorkflowStatus, status_from_events};