Value Specification

Item parameter values are eventually concrete values.

Some of those concrete values are not necessarily known until partway through a flow execution. When a flow is defined, a user needs a way to encode where a value comes from.

%3cluster_acluster_bcluster_caabba->ba_text⚙️appcompilea_paramsParamsrepo_path:/path/to/projectccb->cb_text🖥️serverlaunchb_paramsParamsimage_id:abcd1234instance_size:largec_text📤fileuploadc_paramsParamssrc:/path/to/appdest:user@ip:/path/to/dest

Plain Values

Plain values are values that a user provides before a command is executed.

%3cluster_acluster_bcluster_caabba->ba_text⚙️appcompilea_paramsParamsrepo_path:/path/to/projectccb->cb_text🖥️serverlaunchb_paramsParamsimage_id:abcd1234instance_size:largec_text📤fileuploadc_paramsParamssrc:/path/to/appdest:user@ip:/path/to/dest

A variation of plain values is to provide a lookup function that is evaluated at the point the value is needed, but that has potential negative effects for user experience:

  • Performance: Web service call(s) may take seconds to complete.
  • Consistency: Multiple executions may discover different values between different command executions.

In code, this may look like:

let app_params_spec = AppParams::spec()
    .repo_path(Path::from("/path/to/project"))
    .build();
let server_params_spec = ServerParams::spec()
    .image_id(image_id!("abcd1234"))
    .instance_size(InstanceSize::Large)
    .build();

cmd_ctx_builder
    .with_item_params(app_params_spec)
    .with_item_params(server_params_spec)
    .await?;

Referenced Values

Referenced values are values directly taken from a predecessor's state output.

%3cluster_acluster_bcluster_caabba->ba_text⚙️appcompilea_paramsParamsrepo_path:/path/to/projectccb->cb_text🖥️serverlaunchb_paramsParamsimage_id:abcd1234instance_size:largec_text📤fileuploadc_paramsParamssrc:${app_path}dest:user@ip:/path/to/desta_stateStateapp_path:target/debug/appa_state->c_params

In code, this may look like:

let file_upload_params_spec = FileUploadParams::spec()
    .src_from::<AppOutputPath>()
    // ..
    .build();

cmd_ctx_builder
    .with_item_params(file_upload_params_spec)
    .await?;

Transformed Values
%3cluster_acluster_bcluster_caabba->ba_text⚙️appcompilea_paramsParamsrepo_path:/path/to/projectb_stateStateip:192.168.0.100ccb->cb_text🖥️serverlaunchb_paramsParamsimage_id:abcd1234instance_size:largec_text📤fileuploadc_paramsParamssrc:${app_path}dest:user@${server.ip}:/path/to/destb_state->c_params

In code, this may look like:

let file_upload_params_spec = FileUploadParams::spec()
    // ..
    .dest_from_map::<Server>(|server| {
        let ip = server.ip();
        format!("user@${ip}:/path/to/dest")
    })
    .build();

cmd_ctx_builder
    .with_item_params(file_upload_params_spec)
    .await?;