Flow Definition

  • Items: Steps of a process.
  • Ordering: Sequence between steps.
%3cluster_acluster_bcluster_caabba->ba_text📥filedownloadccb->cb_text🪣s3bucketc_text📤s3object
// examples/envman/src/flows/app_upload_flow.rs
let flow = {
    let graph = {
        let mut graph_builder = ItemGraphBuilder::<EnvManError>::new();

        let [a, b, c] = graph_builder.add_fns([
            FileDownloadItem::<WebApp>::new(item_id!("app_download")).into(),
            S3BucketItem::<WebApp>::new(item_id!("s3_bucket")).into(),
            S3ObjectItem::<WebApp>::new(item_id!("s3_object")).into(),
        ]);

        graph_builder.add_logic_edges([(a, b), (b, c)])?;
        graph_builder.build()
    };

    Flow::new(flow_id!("app_upload"), graph)
};

Non-linear Ordering

%3cluster_acluster_bcluster_caacca->ca_text📥filedownloadbbb->cb_text🪣s3bucketc_text📤s3object
 graph_builder.add_logic_edges([
-    (a, b),
+    (a, c),
     (b, c),
 ])?;