Track A: First workflow
Track A is the first structured tutorial in the ArcFlow learning path. You build a linear two-agent pipeline, run it with the stub provider (no API keys), and verify completion status plus trace lifecycle events. The same workflow can be written in Python or TypeScript; pick one language for this track.
Goal
Complete a linear two-agent pipeline using the stub provider. Confirm result.status == "completed" (SDK) and that trace metadata includes WorkflowStarted, StepCompleted, and WorkflowCompleted.
Prerequisites
| Item | Required |
|---|---|
| SDK installed | Install and build |
| Curriculum (recommended) | Fundamentals, Writing workflows |
| API keys | Not required (stub default) |
| Docker / Postgres | Not required for embedded SDK |
Optional reading: First workflow in five minutes for the minimal script without verification steps.
Primary example
The canonical pipeline matches the five-minute guide: a researcher step followed by a writer step on the topic "Analyze renewable energy trends".
Step 1: Create the workflow file
Python (track_a.py)
TypeScript (track_a.ts)
Run:
Step 2: Verify run outcome
Check these conditions before moving on:
| Check | Expected |
|---|---|
result.output (or result.output in TS) | Non-empty string |
| Step count | 2 |
run_id / runId | UUID string |
status | completed (SDK lowercase) |
Python one-liner assertion (append to your script):
TypeScript equivalent:
These assertions mirror sdk-python/tests/integration/test_first_five_minutes.py.
Step 3: Verify trace lifecycle events
After run(), inspect raw trace events on the result:
Python
TypeScript
Event field name is event_kind in SDK exports (see test_memory_workflow.py and trace bridge). Payloads are metadata only per trace data policy.
Step 4: Use structured trace()
Python
TypeScript
partial may appear when a step completes with degraded metadata; for this stub pipeline, completed is typical.
Step 5: Optional CLI trace view
From the repository root, with the same Python process still holding the in-process trace store, or after any local SDK run:
Replace YOUR_RUN_ID with the UUID printed by your script. This is optional for Track A but previews operator tooling used in Track H.
Expected output (summary)
You should see:
- Printed output text from the stub pipeline (content varies by version).
step_count=2,status=completed, and a UUIDrun_id.- Trace kind set containing at least
WorkflowStarted,StepCompleted, andWorkflowCompleted. trace.summary()reporting two steps and zero or stub token counts.
Exact stub strings are not part of the pass criteria; the integration tests assert structure, not LLM prose.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
ImportError: arcflow | SDK not built | maturin develop in sdk-python/ or npm run build in sdk-typescript/ |
TraceNotFoundError on trace() | trace() before run() | Call run() first on the same Workflow instance |
Empty trace_events | Very old binding | Rebuild native extension |
WorkflowConfigurationError | Invalid agent or empty name | Match the example field names exactly |
What you learned
Track A establishes the core loop: define agents, register ordered steps, call run(), read output, and confirm observability through trace events. Later tracks add server HTTP (Track B), vector memory (Track C), graph routing (Track D), and human-in-the-loop flows (Track E).
Next tracks
| Track | Focus | When to start |
|---|---|---|
| B | Server API, Docker, POST /v1/runs | After A or in parallel if you are a platform engineer |
| C | RAG and Qdrant | After A; requires Docker dev stack |
| H | CLI and VS Code | After A; local tooling |
Continue with Python quickstart or TypeScript quickstart when you want a real LLM provider.