Skip to main content

Module workflow_bundle

Module workflow_bundle 

Source
Expand description

Portable workflow bundle import/export for OxiMedia.

A WorkflowBundle is a self-contained, human-readable description of a workflow that can be serialized to JSON, transmitted, stored in version control, and imported into any OxiMedia installation.

§Design

The bundle uses string IDs and name-based dependency references instead of UUIDs so that hand-editing is ergonomic. All JSON serialization in this module is hand-written — no serde_json derive is used — to remain independent of the serde ecosystem for this lightweight data model.

§Example

use oximedia_workflow::workflow_bundle::{WorkflowBundle, BundleStep};

let mut bundle = WorkflowBundle {
    name: "ingest-pipeline".to_string(),
    version: "1.0.0".to_string(),
    steps: vec![
        BundleStep {
            id: "ingest".to_string(),
            action: "transcode".to_string(),
            params: vec![("input".to_string(), "/raw.mp4".to_string())],
            depends_on: vec![],
        },
        BundleStep {
            id: "upload".to_string(),
            action: "transfer".to_string(),
            params: vec![("dest".to_string(), "s3://bucket/".to_string())],
            depends_on: vec!["ingest".to_string()],
        },
    ],
    metadata: std::collections::HashMap::new(),
};

let json = bundle.to_json();
let parsed = WorkflowBundle::from_json(&json).expect("parse");
assert_eq!(parsed.name, "ingest-pipeline");
assert_eq!(parsed.steps.len(), 2);

bundle.validate().expect("validation should pass");

Structs§

BundleStep
A single processing step within a WorkflowBundle.
WorkflowBundle
A portable, self-contained workflow definition.