pub struct WorkflowIr {Show 20 fields
pub workflow_id: String,
pub version: String,
pub name: Option<String>,
pub description: Option<String>,
pub state_schema: String,
pub start_node: String,
pub nodes: HashMap<String, NodeDef>,
pub edges: Vec<EdgeDef>,
pub retry_policies: HashMap<String, RetryPolicy>,
pub timeouts: TimeoutConfig,
pub models: HashMap<String, ModelConfig>,
pub tools: HashMap<String, ToolConfig>,
pub mcp_servers: HashMap<String, McpServerConfig>,
pub remote_agents: HashMap<String, RemoteAgentConfig>,
pub labels: HashMap<String, String>,
pub policy: Option<PolicySetIr>,
pub token_budget: Option<TokenBudgetIr>,
pub cost_budget_usd: Option<f64>,
pub on_budget_exceeded: Option<String>,
pub data_policy: Option<DataPolicyIr>,
}Expand description
The canonical Intermediate Representation for a JamJet workflow.
Both YAML and Python workflow definitions compile to this struct before being submitted to the runtime. The IR is serializable to JSON and YAML.
Fields§
§workflow_id: StringUnique workflow definition identifier.
version: StringSemantic version string (e.g., “1.0.0”).
name: Option<String>Human-readable name.
description: Option<String>Optional description.
state_schema: StringReference to the Pydantic model or JSON Schema for workflow state.
start_node: StringThe first node to execute.
nodes: HashMap<String, NodeDef>All nodes in the workflow graph, keyed by node id.
edges: Vec<EdgeDef>All edges (transitions) between nodes.
retry_policies: HashMap<String, RetryPolicy>Named retry policies referenced by nodes.
timeouts: TimeoutConfigTimeout configuration for this workflow.
models: HashMap<String, ModelConfig>Named model configurations referenced by model nodes.
tools: HashMap<String, ToolConfig>Named tool configurations referenced by tool nodes.
mcp_servers: HashMap<String, McpServerConfig>Named MCP server configurations.
remote_agents: HashMap<String, RemoteAgentConfig>Named remote A2A agents.
labels: HashMap<String, String>Observability labels attached to all spans from this workflow.
policy: Option<PolicySetIr>Workflow-level policy set (overrides global; node-level overrides this).
token_budget: Option<TokenBudgetIr>Per-execution token budget enforcement.
cost_budget_usd: Option<f64>Per-execution cost cap in USD. Execution fails / branches when exceeded.
on_budget_exceeded: Option<String>Node to route to when any budget is exceeded (optional).
If absent, the execution fails with WorkflowFailed.
data_policy: Option<DataPolicyIr>Data handling policy (PII redaction + retention controls).
Implementations§
Source§impl WorkflowIr
impl WorkflowIr
Sourcepub fn to_json_pretty(&self) -> Result<String, Error>
pub fn to_json_pretty(&self) -> Result<String, Error>
Serialize to JSON (pretty-printed).
Sourcepub fn edges_from(&self, node_id: &str) -> Vec<&EdgeDef>
pub fn edges_from(&self, node_id: &str) -> Vec<&EdgeDef>
Return all edges originating from a given node.
Sourcepub fn successors(&self, node_id: &str) -> Vec<&str>
pub fn successors(&self, node_id: &str) -> Vec<&str>
Return the successors of a node (all nodes it can transition to).
Trait Implementations§
Source§impl Clone for WorkflowIr
impl Clone for WorkflowIr
Source§fn clone(&self) -> WorkflowIr
fn clone(&self) -> WorkflowIr
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more