Workflow Orchestration
The Data Governance solution uses Prefect for orchestrating data profiling, metadata enrichment, and data quality (DQ) rule generation workflows. Prefect provides task scheduling, concurrency control, observability, and failure handling.Architecture
- Infrastructure
- Flow Definitions
All Prefect services are deployed alongside the Data Governance API via Docker Compose (local dev) or Helm (Kubernetes).
Available Workflows
Data Profiling Flow
Analyzes connected data sources to produce statistical profiles:Profiling, Metadata Assessment, and DQ Assessment workflows require schema-level or table-level targets. Database-level targets (entire database) are not supported, specify individual schemas or tables to process.
Metadata Enrichment Flow
Uses LLMs to generate business descriptions and classifications:DQ Rule Generation Flow
Generates data quality rules based on profiling data and LLM analysis:
DQ rule generation does not require a reference pack. Earlier versions passed an industry context / reference pack into the workflow; that input was removed because it caused crashes under Prefect 3.x. Generation runs purely from schema context, profiling results, and metadata.
Workflow approval and the scorecard
When you approve (“Save”) a profiling or enrichment workflow run, the platform applies two changes atomically:- Tombstone affected metric snapshots. Affected
metric_snapshotsrows are written withnumerator=0, denominator=0. This invalidates the prior score so the scorecard does not display stale numbers while the next assessment is pending. - Resolve all matching OPEN violations. Every
OPENviolation tied to an invalidated metric is closed in the same transaction, not just the most recent. Previously the resolve step closed only the latest violation, leaving older OPEN duplicates on the dashboard.
FQN scoping for violations
Violations are filtered byasset_fqn using an exact-or-child boundary: a filter for db.schema.card matches db.schema.card itself and any column-level child like db.schema.card.amount, but does not match sibling tables with prefix collisions like db.schema.cardtransaction. Earlier versions used a plain startswith, which produced false matches on sibling tables sharing a name prefix.
Ingestion triggered by asset.created
When an ingestion run is triggered by an asset.created event (or kicked off manually with no schemas listed in config), the workflow ingests all schemas in the connection, scoped by config.database. Earlier versions only ingested the first schema returned by the connection, which led to silent data gaps when a connection exposed multiple schemas.
Concurrency Model
Workflows use a hybrid concurrency model combining Prefect’s task runner with asyncio semaphores:Flow-Level Concurrency
TheConcurrentTaskRunner controls how many table-level tasks run simultaneously:
Task-Level Concurrency
Within each task,asyncio.Semaphore controls fine-grained concurrency (e.g., LLM API calls):
Workflow Management
Prefect UI
The Prefect UI (port 4200) provides visibility into workflow execution:- Flow runs: Status, duration, logs for each execution
- Task runs: Individual task status within a flow
- Deployments: Registered flow definitions and schedules
- Work pool: Worker status and queue depth
Configuration
Workflow configuration is managed via OmegaConf with environment variable overrides:config.yaml > defaults
Environment variables can be referenced in config via OmegaConf’s ${oc.env:VAR_NAME, default} syntax. The CRAFT default is Vertex AI — common env vars are ${oc.env:VERTEXAI_PROJECT} / ${oc.env:VERTEXAI_LOCATION, global} (also accepts the Google Cloud SDK standards GOOGLE_CLOUD_PROJECT / GOOGLE_CLOUD_LOCATION) with GOOGLE_APPLICATION_CREDENTIALS for ADC. Provider-specific keys (OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY) are only required when the configured model routes to a non-Vertex provider.
Error Handling
Kubernetes Deployment
In Kubernetes, Prefect workflows run as pods in thekubernetes-pool work pool:
Next Steps
Data Profiling
Learn about the profiling workflow in detail.
Data Enrichment
Understand the LLM-powered enrichment pipeline.
Data Source Setup
Connect a database to use with governance workflows.

