Python SDK — Declarative YAML governance workflows with job dependencies and org-level inheritance.
TealFlow enables declarative governance workflows defined in YAML. Teams define governance pipelines as composable jobs with dependencies, conditions, and org-level inheritance. Parent organizations set governance floors that child teams cannot weaken.
Installation
pip install tealtiger
Quick Start
import asynciofrom tealtiger.flow import TealFlowasync def main(): # Load workflow from YAML flow = await TealFlow.from_file(".tealtiger/workflows/production.yaml") # Validate workflow validation = flow.validate() if not validation.valid: for error in validation.errors: print(f"[{error.type}] {error.job}: {error.message}") return # Execute workflow against a request result = await flow.execute(request, ctx) print(result.decision.action) # Final merged decision print(result.execution_order) # Actual execution order print(f"Duration: {result.duration_ms}ms")asyncio.run(main())
Jobs declare dependencies and TealFlow resolves the execution graph, parallelizing independent jobs:
jobs: A: module: teal-classifier # No dependencies — runs first B: module: teal-secrets depends_on: [A] # Runs after A C: module: teal-drift depends_on: [A] # Runs after A (parallel with B) D: module: teal-proof depends_on: [B, C] # Runs after both B and C
Execution timeline:
Time → A ─────┐ ├── B ────┐ │ ├── D └── C ────┘
Circular dependencies are detected at validation time and rejected.
Org-Level Inheritance
Organizations define base workflows with floor enforcement. Child workflows can add jobs but cannot remove or weaken inherited jobs.