Skip to main content

aion_core/
describe.rs

1//! Describe-workflow response projection.
2//!
3//! The ops console's `POST /workflows/describe` read consumes exactly this shape:
4//! a workflow [`WorkflowSummary`] projection plus the run's event [`Event`]
5//! history as plain JSON. Defining it here lets the same type be exported to
6//! TypeScript (so the generated bindings match the wire by construction) and be
7//! produced directly by the HTTP handler at the transport boundary.
8
9use serde::{Deserialize, Serialize};
10
11use crate::{Event, WorkflowSummary};
12
13/// Response to a describe-workflow request.
14///
15/// `history` is the run's events as plain serialized [`Event`] values (never a
16/// protobuf-derived envelope), so the ops console decodes each entry directly.
17/// When `include_history` is false the server returns an empty `history`.
18#[derive(Serialize, Deserialize, ts_rs::TS, Clone, Debug, PartialEq)]
19pub struct DescribeWorkflowResponse {
20    /// Workflow summary projected from authoritative history, when the workflow
21    /// exists.
22    pub summary: Option<WorkflowSummary>,
23    /// The run's event history as plain serialized events.
24    pub history: Vec<Event>,
25}