Parallel Execution

How Bluebricks executes blueprint packages in parallel based on their dependencies

When a run starts, Bluebricks builds a dependency graph (DAG) from the Data references in your blueprint. Independent packages execute in parallel; dependent packages wait for their inputs to be ready.

Data references

Data references let one package consume the outputs of another:

Data.<packageId>.<outputKey>
  • Data. is the reserved prefix for cross-package references

  • <packageId> is the unique ID of the source package

  • <outputKey> is the name of the output

chevron-rightExamplehashtag
{
  "packages": [
    {
      "id": "vpc_module",
      "props": {
        "region": { "value": "Props.region" }
      }
    },
    {
      "id": "eks_cluster",
      "props": {
        "vpc_id": { "value": "Data.vpc_module.vpc_id" },
        "subnet_ids": { "value": "Data.vpc_module.private_subnet_ids" }
      }
    }
  ]
}

Here eks_cluster depends on vpc_module. Bluebricks executes vpc_module first, then passes its vpc_id and private_subnet_ids outputs to eks_cluster.

Data references in expressions

You can combine Data references with other values using expr expressions:

chevron-rightExamplehashtag
{
  "props": {
    "bucket_name": {
      "value": "'my-app-' + Data.vpc_module.vpc_id + '-logs'"
    },
    "enable_logging": {
      "value": "Props.create_bucket || Data.s3_module.bucket_exists"
    }
  }
}

Expressions are evaluated at runtime after dependencies complete.

Execution order

Bluebricks determines execution order automatically from your Data references. Consider this blueprint:

chevron-rightExamplehashtag
spinner

launch_template runs first because it has no dependencies. Once it completes, s3_bucket and monitoring run in parallel since both depend only on launch_template.

Data references can also chain across nested blueprints — Bluebricks resolves the full dependency chain automatically, regardless of nesting depth.

Tips for faster runs

Fewer Data references between packages means more parallel execution. Where possible, use Props (set at deployment time) instead of Data (resolved at runtime) to keep packages independent.

chevron-rightSequential: each package depends on the previous onehashtag
chevron-rightParallel: packages use properties instead of cross-package Data referenceshashtag

Best practices

  • Use Props for static configuration, Data for runtime values

  • Never create circular dependencies (A depends on B, B depends on A)

  • Reference only outputs that will definitely be available

  • Use descriptive output keys so Data references are self-documenting

  • Keep expressions readable; avoid deeply nested logic

See also

Last updated

Was this helpful?