Colab 03: Excel Visualization#
This OpenRath v2.0.0 example turns a fixed sales CSV into an editable Excel workbook with formulas, KPIs, charts, previews, and automated quality checks. It demonstrates how a router can block bad input before any artifact is built.
Open in Google Colab · View the workflow source · View the reference workbook
Input and Output#
Input |
Output |
|---|---|
|
|
The generated workbook contains four worksheets:
Worksheet |
Contents |
|---|---|
|
The typed source rows in an Excel table. |
|
Visible regional, monthly, gross-profit, and return-rate formulas. |
|
Four KPIs plus regional and monthly charts. |
|
Purpose, traceability, generation, and security notes. |
Workflow#
Node |
What happens |
|---|---|
|
Counts missing cells and duplicate business keys, then computes the source profile. |
|
Sends clean data to planning or routes invalid data to |
|
Requests validated presentation text while preserving program-computed values. |
|
Builds the four-sheet XLSX and four visual previews. |
|
Rejects missing previews or Excel formula errors before publishing the artifact. |
The LLM supplies only bounded presentation wording. Revenue, orders, return rate, region totals, month totals, KPI formulas, and chart data all come from the CSV and deterministic workbook builder.
Quality Routing#
@router(successors=("plan_dashboard", "stop_for_quality"))
def quality_route(self, state):
return (
"plan_dashboard"
if state["profile"]["quality"] == "pass"
else "stop_for_quality"
)
For this example, data quality passes only when rows exist and both missing cells and duplicate business keys equal zero. A blocked dataset never reaches the LLM planning or workbook-build steps.
Run and Verify#
Open the Notebook in Google Colab.
Choose Runtime → Run all.
Enter the DeepSeek API key in the masked prompt.
Review the dashboard preview and download the workbook.
The Notebook verifies:
the durable run finishes as
SUCCEEDED;the profile contains 24 rows and a
passdecision;all four worksheets have visual previews;
the formula audit finds no
#REF!,#DIV/0!,#VALUE!,#NAME?, or#N/A;five checkpoints are stored;
the workbook is registered under an
artifact://local/URI.
Adapt It#
Replace sales.csv while preserving the published column contract, or update
the profiler and portable builder together for a new schema. Add new quality
rules before quality_route so invalid data remains outside artifact-building
steps.