Script workflows are sequences of steps. Each step: natural language in, TypeScript out, deterministic execution.
The Flow
Describe step → Generate TypeScript → Execute → Output files → Next step
You describe what a step should do
AI generates TypeScript code (once, at build time)
Code runs in a secure sandbox
Step outputs files for downstream steps
Repeat for each step in your workflow
Deterministic Execution
Unlike agents that make AI decisions at runtime:
| Feature | Script |
|---|
| Predictability | Same inputs → same outputs every time |
| Runtime AI | None — code path is fixed at generation |
| Debugging | Errors show exactly where and why |
The AI runs once during generation. At runtime, it’s just code.
Step Structure
┌─────────────────────────────────────┐
│ "Fetch orders from Shopify" │ ← Your description
├─────────────────────────────────────┤
│ Generated TypeScript │ ← AI-generated code
│ • Calls Shopify API │
│ • Transforms response │
│ • Writes output files │
├─────────────────────────────────────┤
│ Outputs: orders.csv, summary.json │ ← Available to next step
└─────────────────────────────────────┘
Outputs
| Type | Description |
|---|
| CSV / JSON | Structured data |
| Dashboard | Charts, metrics |
| HITL Form | Human approval UI |
| Spreadsheet | Google Sheets |
| Markdown | Reports |
Iteration
First try: Most workflows work immediately.
Refinement: Describe what to change. AI updates the code. Usually 1 iteration, sometimes 2-3 for edge cases.
Faster than editing code manually. More precise than re-explaining from scratch.
Next