Execution Workflow
Run the notebook in order.
Core Workflow
Environment Setup
- Imports dependencies.
- Verifies the OpenAI Agents SDK version.
- Reads
OPENAI_API_KEY. - Configures tracing and model selection.
Input
- Defines
CHANGE_TEXT. - This is the only required business input for the core workflow.
- Defines
Optional PDF RAG Context
- Leave
PDF_PATH = Noneto run without retrieval. - Set
PDF_PATHto a local PDF to enable File Search context for impact analysis.
- Leave
Stages 1-2
- Parse the change request.
- Analyze impact.
- Optionally use File Search during impact analysis.
Stages 1-2 Guardrails
- Confirm parse output is well-formed.
- Confirm impact output includes the target.
- Confirm impacted objects contain required fields.
Stages 3-4
- Generate an execution plan.
- Generate SQL across landing, staging, core, and mart layers.
Stages 3-4 Guardrails
- Confirm plan sections are populated.
- Confirm data type propagation.
- Confirm nullability behavior matches the request.
Stage 5 SQL Sanity Checks
- Check for empty SQL.
- Check expected target table and columns.
- Check required SQL actions implied by the request.
Final Bundle and Artifact
- Assemble the full output bundle.
- Save it as JSON.
- Verify the artifact round-trips successfully.
Optional Eval Workflow
Pre-Promptfoo Checks
- Confirm the notebook state is ready for evals.
Promptfoo Runtime Generation
- Create a reusable SchemaFlow core module.
- Write a Promptfoo provider.
- Write a Promptfoo assertion file.
- Generate Promptfoo test cases and config.
Promptfoo Eval Execution
- Run parse-only and full-flow evals.
- Save timestamped JSON and HTML reports.
- Refresh
schemaflow_cookbook_eval_latest.*aliases.