# googlecloudplatform/cortex-framework architecture

> Architecture diagram of the GitHub repository googlecloudplatform/cortex-framework, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/googlecloudplatform/cortex-framework
- Repository: https://github.com/googlecloudplatform/cortex-framework

## Overview

Cortex Framework builds and deploys modular, Dataform-orchestrated BigQuery data foundations and data products, especially for SAP ECC, S/4HANA, and SAP BDC. The main workflow is configuration loading and validation, module resolution and SQL generation, then deployment through Dataform; optional branches cover environment checks, Knowledge Catalog synchronization, external lakehouse catalogs, sample data, and telemetry. The README documents several capabilities whose implementation was not sampled, so those relationships are shown as documented rather than inferred from source calls.

Main entry points: [`src/tools/build.py`](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/tools/build.py) (Build or deploy CLI), [`src/tools/deploy.py`](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/tools/deploy.py) (Deployment orchestrator), [`src/common/services/config_loader.py`](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/services/config_loader.py) (Config loader), [`src/common/registry.py`](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/registry.py) (Plugin registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_config["Configuration and modules"]
  node_config_cli["Build or deploy CLI<br/>[build.py]"]
  node_config_loader["Config loader<br/>[config_loader.py]"]
  node_config_schema["Config models<br/>[config_schema.py]"]
  node_module_providers["Module providers"]
  node_module_registry["Plugin registry<br/>[registry.py]"]
  node_module_manifest["Module manifests<br/>[manifest_schema.py]"]
end

subgraph group_build["Data product build"]
  node_sap_builder["SAP product builder"]
  node_foundation_builder["SAP foundation builder<br/>[builder.py]"]
  node_sap_products["SAP data products"]
  node_compat_products["V6 compatibility products"]
  node_sql_includes["Dataform SQL includes"]
end

subgraph group_deploy["Cloud deployment"]
  node_deployer["Deployment orchestrator<br/>[deploy.py]"]
  node_deployment_actions["Deployment actions<br/>[actions.py]"]
  node_dataform_client["Dataform client<br/>[dataform.py]"]
  node_bigquery_client["BigQuery client<br/>[bigquery.py]"]
  node_gcp_checker["GCP environment checks"]
end

subgraph group_operations["Metadata and operations"]
  node_catalog_sync["Knowledge Catalog sync"]
  node_catalog_client["Knowledge Catalog client<br/>[data_product.py]"]
  node_lakehouse_provider["External catalog provider"]
  node_lakehouse_client["Lakehouse client<br/>[lakehouse.py]"]
  node_telemetry["Telemetry"]
  node_consent["Telemetry consent<br/>[consent_manager.py]"]
  node_resource_manager["Resource Manager client"]
end

node_user(("Framework user"))
node_bigquery[("Google BigQuery")]
node_dataform["Google Dataform"]

node_user -->|"runs"| node_config_cli
node_config_cli -->|"loads config"| node_config_loader
node_config_loader -->|"validates as"| node_config_schema
node_config_loader -->|"resolves modules"| node_module_providers
node_module_providers -.->|"discovers plugins"| node_module_registry
node_config_cli -->|"selects deployer"| node_module_registry
node_module_registry -->|"registers builders"| node_module_manifest
node_config_cli -->|"builds modules"| node_foundation_builder
node_config_cli -.->|"builds modules"| node_sap_builder
node_sap_builder -->|"uses registry"| node_module_registry
node_foundation_builder -.->|"generates foundation"| node_sap_products
node_config_cli -.->|"generates products"| node_sap_products
node_config_cli -.->|"generates products"| node_compat_products
node_sap_products -.->|"uses SQL helpers"| node_sql_includes
node_user -->|"runs deployment"| node_deployer
node_deployer -->|"loads config"| node_config_loader
node_deployer -->|"executes actions"| node_deployment_actions
node_deployment_actions -->|"calls API"| node_dataform_client
node_dataform_client -.->|"deploys workflows"| node_dataform
node_dataform -->|"executes SQL"| node_bigquery
node_deployer -->|"checks environment"| node_gcp_checker
node_gcp_checker -->|"checks datasets"| node_bigquery_client
node_bigquery_client -.->|"reads and writes"| node_bigquery
node_deployer -.->|"syncs metadata"| node_catalog_sync
node_catalog_sync -.->|"publishes products"| node_catalog_client
node_catalog_client -.->|"describes products"| node_bigquery
node_module_providers -->|"resolves catalogs"| node_lakehouse_provider
node_lakehouse_provider -->|"uses client"| node_lakehouse_client
node_deployer -->|"reports usage"| node_telemetry
node_telemetry -->|"checks consent"| node_consent
node_telemetry -->|"gets project data"| node_resource_manager

click node_config_cli "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/tools/build.py"
click node_config_loader "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/services/config_loader.py"
click node_config_schema "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/schemas/config_schema.py"
click node_module_providers "https://github.com/googlecloudplatform/cortex-framework/tree/main/src/common/services"
click node_module_registry "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/registry.py"
click node_module_manifest "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/schemas/manifest_schema.py"
click node_sap_builder "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/builders/sap_product_builder.py"
click node_foundation_builder "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/data_modules/cortex/sap/foundations/sap/builder.py"
click node_sap_products "https://github.com/googlecloudplatform/cortex-framework/tree/main/src/data_modules/cortex/sap/products"
click node_compat_products "https://github.com/googlecloudplatform/cortex-framework/tree/main/src/data_modules/cortex_v6_compatibility/sap/products"
click node_sql_includes "https://github.com/googlecloudplatform/cortex-framework/tree/main/src/dataform_includes"
click node_deployer "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/tools/deploy.py"
click node_deployment_actions "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/deployers/actions.py"
click node_dataform_client "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/clients/dataform.py"
click node_bigquery_client "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/clients/bq/bigquery.py"
click node_gcp_checker "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/services/gcp_environment_checker.py"
click node_catalog_sync "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/services/dataplex/data_products_sync.py"
click node_catalog_client "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/clients/dataplex/data_product.py"
click node_lakehouse_provider "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/services/external_module_provider.py"
click node_lakehouse_client "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/clients/lakehouse.py"
click node_telemetry "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/services/telemetry/telemetry_logger.py"
click node_consent "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/services/telemetry/consent_manager.py"
click node_resource_manager "https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/clients/resource_manager.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_config_cli,node_config_loader,node_config_schema,node_module_providers,node_module_registry,node_module_manifest,node_user toneBlue
class node_sap_builder,node_foundation_builder,node_sap_products,node_compat_products,node_sql_includes,node_bigquery toneAmber
class node_deployer,node_deployment_actions,node_dataform_client,node_bigquery_client,node_gcp_checker toneMint
class node_catalog_sync,node_catalog_client,node_lakehouse_provider,node_lakehouse_client,node_telemetry,node_consent,node_resource_manager toneRose
class node_dataform toneIndigo
```

## Components

### Configuration and modules

- [Build or deploy CLI](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/tools/build.py): `src/tools/build.py`
- [Config loader](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/services/config_loader.py): `src/common/services/config_loader.py`
- [Config models](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/schemas/config_schema.py): `src/common/schemas/config_schema.py`
- [Module providers](https://github.com/googlecloudplatform/cortex-framework/tree/main/src/common/services): `src/common/services`
- [Plugin registry](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/registry.py): `src/common/registry.py`
- [Module manifests](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/schemas/manifest_schema.py): `src/common/schemas/manifest_schema.py`

### Data product build

- [SAP product builder](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/builders/sap_product_builder.py): `src/common/builders/sap_product_builder.py`
- [SAP foundation builder](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/data_modules/cortex/sap/foundations/sap/builder.py): `src/data_modules/cortex/sap/foundations/sap/builder.py`
- [SAP data products](https://github.com/googlecloudplatform/cortex-framework/tree/main/src/data_modules/cortex/sap/products): `src/data_modules/cortex/sap/products`
- [V6 compatibility products](https://github.com/googlecloudplatform/cortex-framework/tree/main/src/data_modules/cortex_v6_compatibility/sap/products): `src/data_modules/cortex_v6_compatibility/sap/products`
- [Dataform SQL includes](https://github.com/googlecloudplatform/cortex-framework/tree/main/src/dataform_includes): `src/dataform_includes`

### Cloud deployment

- [Deployment orchestrator](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/tools/deploy.py): `src/tools/deploy.py`
- [Deployment actions](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/deployers/actions.py): `src/common/deployers/actions.py`
- [Dataform client](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/clients/dataform.py): `src/common/clients/dataform.py`
- [BigQuery client](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/clients/bq/bigquery.py): `src/common/clients/bq/bigquery.py`
- [GCP environment checks](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/services/gcp_environment_checker.py): `src/common/services/gcp_environment_checker.py`

### Metadata and operations

- [Knowledge Catalog sync](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/services/dataplex/data_products_sync.py): `src/common/services/dataplex/data_products_sync.py`
- [Knowledge Catalog client](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/clients/dataplex/data_product.py): `src/common/clients/dataplex/data_product.py`
- [External catalog provider](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/services/external_module_provider.py): `src/common/services/external_module_provider.py`
- [Lakehouse client](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/clients/lakehouse.py): `src/common/clients/lakehouse.py`
- [Telemetry](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/services/telemetry/telemetry_logger.py): `src/common/services/telemetry/telemetry_logger.py`
- [Telemetry consent](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/services/telemetry/consent_manager.py): `src/common/services/telemetry/consent_manager.py`
- [Resource Manager client](https://github.com/googlecloudplatform/cortex-framework/blob/main/src/common/clients/resource_manager.py): `src/common/clients/resource_manager.py`

### Other components

- **Framework user**
- **Google BigQuery**
- **Google Dataform**

## Connections

- Framework user → Build or deploy CLI: runs (evidence: `README.md`)
- Build or deploy CLI → Config loader: loads config (evidence: `src/tools/build.py`)
- Config loader → Config models: validates as (evidence: `src/common/services/config_loader.py`)
- Config loader → Module providers: resolves modules (evidence: `src/common/services/config_loader.py`)
- Module providers → Plugin registry: discovers plugins
- Build or deploy CLI → Plugin registry: selects deployer (evidence: `src/tools/build.py`)
- Plugin registry → Module manifests: registers builders (evidence: `src/common/registry.py`)
- Build or deploy CLI → SAP foundation builder: builds modules (evidence: `src/tools/build.py`)
- Build or deploy CLI → SAP product builder: builds modules
- SAP product builder → Plugin registry: uses registry (evidence: `src/common/builders/sap_product_builder.py`)
- SAP foundation builder → SAP data products: generates foundation
- Build or deploy CLI → SAP data products: generates products (evidence: `README.md`)
- Build or deploy CLI → V6 compatibility products: generates products (evidence: `README.md`)
- SAP data products → Dataform SQL includes: uses SQL helpers (evidence: `README.md`)
- Framework user → Deployment orchestrator: runs deployment (evidence: `README.md`)
- Deployment orchestrator → Config loader: loads config (evidence: `src/tools/deploy.py`)
- Deployment orchestrator → Deployment actions: executes actions (evidence: `src/common/deployers/actions.py`)
- Deployment actions → Dataform client: calls API (evidence: `src/common/deployers/actions.py`)
- Dataform client → Google Dataform: deploys workflows (evidence: `README.md`)
- Google Dataform → Google BigQuery: executes SQL (evidence: `README.md`)
- Deployment orchestrator → GCP environment checks: checks environment (evidence: `src/tools/deploy.py`)
- GCP environment checks → BigQuery client: checks datasets (evidence: `src/common/services/gcp_environment_checker.py`)
- BigQuery client → Google BigQuery: reads and writes (evidence: `src/common/clients/bq/bigquery.py`)
- Deployment orchestrator → Knowledge Catalog sync: syncs metadata (evidence: `README.md`)
- Knowledge Catalog sync → Knowledge Catalog client: publishes products
- Knowledge Catalog client → Google BigQuery: describes products (evidence: `README.md`)
- Module providers → External catalog provider: resolves catalogs (evidence: `src/common/services/config_loader.py`)
- External catalog provider → Lakehouse client: uses client (evidence: `src/common/services/external_module_provider.py`)
- Deployment orchestrator → Telemetry: reports usage (evidence: `src/tools/deploy.py`)
- Telemetry → Telemetry consent: checks consent (evidence: `src/common/services/telemetry/telemetry_logger.py`)
- Telemetry → Resource Manager client: gets project data (evidence: `src/common/services/telemetry/telemetry_logger.py`)
