The pitch for the notebook fits in two sentences and one number: spent 14 cents teaching an AI to design its own workflow — and emit the Python code that replaces future AI calls entirely. Free, 29 cells, Claude or GPT or Gemini, bring one API key. The whole thing is on GitHub: CompleteTech-LLC/build-ai-workflows-in-5-steps, and lives in the portfolio at ctech.llc/5step2workflow.
This is a field note on what the notebook actually teaches and why step 5 is the one that pays for itself.
The five techniques
- Goal-first context priming — show the AI the destination, not the task. The notebook opens with a target dashboard image (a tax-readiness scorecard) before it ever loads the source document. Every prompt downstream is anchored to that picture.
- Source priming in stages — load the source document in pieces, each with a specific lens, instead of pasting the whole thing at once. The shipped example uses a messy synthetic one-page financial pack for “Sample Bistro & Co.” with deliberate friction baked in (non-calendar fiscal periods, negative-revenue conventions, ambiguous owner salary).
- Task decomposition with structured execution contracts — the AI doesn’t just describe what to do; it produces a contract with inputs, outputs, success criteria, and judgment points. Repeatable enough that the next run knows what done looks like.
- Visual workflow design in Mermaid — the AI renders the contract as a flowchart you can read at a glance. The workflow becomes a thing you can argue with before you spend any more tokens.
- Workflow crystallization — the punch line. The AI emits deterministic Python for the repetitive parts and reserves AI calls only for the steps that actually need judgment.
Step 5 is the one you’ll wish you learned years ago
This is the line from the X thread that I keep coming back to:
Use the expensive model once, at design time. It emits deterministic Python for the repetitive parts and calls itself only where judgment is needed. Future runs skip the design phase. You pay for the AI once, not forever.
Most AI-as-glue workflows have the AI in the hot path. Every run, every record, every customer call — you’re paying tokens for the same reasoning the model already did last week. Step 5 inverts the cost curve. The expensive model thinks once, encodes the result as code, and the code does the work. The AI re-enters only where the deterministic path can’t make a defensible call.
That’s why a 14-cent design pass can replace a thousand future AI calls. The cost-shape changes from per-run to per-design. Production workflows shouldn’t have an LLM in the inner loop unless judgment is actually required there.
The shipped example, briefly
The notebook walks the entire arc on a real example: messy restaurant P&L → executable dashboard workflow. By cell 29 you have a Mermaid diagram, a structured contract, and a Python module that can re-run the transformation without an API call.
To retarget it to a different domain, swap two file paths: the goal image and the source document. The five-step method holds; the example moves.
Why this lives in the portfolio
The lesson is provider-agnostic by design — thin adapter cells wrap real Anthropic, OpenAI, and Google SDK code, so the “Claude or GPT or Gemini” choice is just an environment variable. MIT licensed, so it can be re-cut for client work without friction. The repo is under CompleteTech-LLC on GitHub; the polished version sits as Specimen 03 in the Field Artifacts catalog.
If you only read one cell, read the one where the AI hands its own work back as Python. That’s the one I want every developer who’s wondering “how do I make AI cheap in production?” to spend a Saturday on.
Notebook: github.com/CompleteTech-LLC/build-ai-workflows-in-5-steps
Portfolio: ctech.llc/5step2workflow
Originally published as an X thread: Apr 11, 2026, 12:05 PM CDT.
