Skip to main content

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/// Describe-workflow response projection (summary + event history).
20pub mod describe;
21/// Error types shared by workflow engines, callers, and activities.
22pub mod error;
23/// Durable workflow history events and envelopes.
24pub mod event;
25/// Workflow visibility filters and summaries.
26pub mod filter;
27#[cfg(test)]
28mod generated_types;
29/// Strongly typed identifiers for workflows, runs, activities, timers, and schedules.
30pub mod ids;
31/// Type-erased payload bytes with explicit content-type metadata.
32pub mod payload;
33/// Schedule configuration, trigger, and catch-up policy models.
34pub mod schedule;
35/// Search-attribute schemas and values used by visibility queries.
36pub mod search;
37/// Workflow lifecycle status derivation.
38pub mod status;
39
40pub use describe::DescribeWorkflowResponse;
41pub use error::{ActivityError, ActivityErrorKind, WorkflowError};
42pub use event::{DEFAULT_TASK_QUEUE, Event, EventEnvelope, WithTimeoutOutcome};
43pub use filter::{WorkflowFilter, WorkflowSummary};
44pub use ids::{ActivityId, IdError, PackageVersion, RunId, TimerId, TimerIdKind, WorkflowId};
45pub use payload::{ContentType, Payload, PayloadError};
46pub use schedule::{CatchUpPolicy, OverlapPolicy, ScheduleConfig, ScheduleId, TriggerSpec};
47pub use search::{
48    SearchAttributeError, SearchAttributeSchema, SearchAttributeType, SearchAttributeValue,
49    search_attributes_from_events,
50};
51pub use status::{WorkflowStatus, current_lease_terminal, run_segment, status_from_events};