These examples demonstrate how to use AxonFlow's Unified Execution Tracking API to monitor both MAP plans and WCP workflows with a consistent interface.
Issue #1075 - EPIC #1074: Unified Workflow Infrastructure
- Unified
ExecutionStatusschema for MAP plans and WCP workflows getExecutionStatus()- Get status by execution IDlistUnifiedExecutions()- List executions with filtersExecutionHelpers- Utility functions for working with execution data- Real-time progress tracking with step-level details
- Cost tracking per step and total
- AxonFlow Agent running (default:
http://localhost:8080) - AxonFlow Orchestrator running (default:
http://localhost:8081) - SDK installed for your language (for SDK examples)
All examples support these environment variables:
| Variable | Default | Description |
|---|---|---|
AXONFLOW_AGENT_URL |
http://localhost:8080 |
AxonFlow Agent URL |
AXONFLOW_ORCHESTRATOR_URL |
http://localhost:8081 |
AxonFlow Orchestrator URL |
AXONFLOW_CLIENT_ID |
demo |
Client ID for authentication |
AXONFLOW_CLIENT_SECRET |
demo |
Client secret for authentication |
cd http
chmod +x example.sh
./example.shcd python
pip install -r requirements.txt
python main.pycd go
go run main.gocd typescript
npm install
npm startcd java
mvn compile exec:java -Dexec.mainClass="com.getaxonflow.examples.ExecutionTrackingExample"Each example demonstrates the unified execution tracking API:
- Create a MAP plan to generate an execution ID
- Track execution using
getExecutionStatus()with real-time progress updates - Display step-level progress using the unified
UnifiedStepStatusformat - Show final results including execution type, duration, and costs
- List executions using
listUnifiedExecutions()with type filtering
AxonFlow Unified Execution Tracking Example - [Language]
=======================================================
Creating MAP plan...
Plan ID: plan_abc123
Execution ID: exec_xyz789
Tracking execution with unified API...
[1s] Type: map_plan, Status: pending, Progress: 0.0%
[2s] Type: map_plan, Status: running, Progress: 0.0%
Step 0 (analyze): running
[3s] Type: map_plan, Status: running, Progress: 33.3%
Step 0 (analyze): completed (2s)
Step 1 (research): running
[5s] Type: map_plan, Status: running, Progress: 66.7%
Step 0 (analyze): completed (2s)
Step 1 (research): completed (3s)
Step 2 (synthesize): running
[8s] Type: map_plan, Status: completed, Progress: 100.0%
Execution Complete!
-------------------------------------------------------
Execution Type: MAP Plan
Duration: 8s
Total Cost: $0.0420
Steps:
1. analyze: completed (2s) - $0.0100 [llm_call]
2. research: completed (3s) - $0.0200 [tool_call]
3. synthesize: completed (3s) - $0.0120 [synthesis]
Listing recent MAP executions...
Found 15 MAP executions (showing 5)
=======================================================
Unified Execution Tracking Test: PASS
Both MAP plans and WCP workflows return the same unified schema:
{
"execution_id": "exec_xyz789",
"execution_type": "map_plan",
"name": "Analyze data",
"status": "running",
"current_step_index": 1,
"total_steps": 3,
"progress_percent": 33.33,
"started_at": "2026-01-24T10:00:00Z",
"duration": "5s",
"estimated_cost_usd": 0.05,
"actual_cost_usd": 0.02,
"steps": [
{
"step_id": "step_0_analyze",
"step_index": 0,
"step_name": "analyze",
"step_type": "llm_call",
"status": "completed",
"started_at": "2026-01-24T10:00:00Z",
"ended_at": "2026-01-24T10:00:02Z",
"duration": "2s",
"cost_usd": 0.01,
"model": "gpt-4",
"provider": "openai"
},
{
"step_id": "step_1_research",
"step_index": 1,
"step_name": "research",
"step_type": "tool_call",
"status": "running",
"started_at": "2026-01-24T10:00:02Z"
}
],
"tenant_id": "tenant_123",
"org_id": "org_456",
"user_id": "user_789",
"created_at": "2026-01-24T10:00:00Z",
"updated_at": "2026-01-24T10:00:05Z"
}| Type | Description |
|---|---|
map_plan |
Multi-Agent Planning execution |
wcp_workflow |
Workflow Control Plane execution |
| Status | Description |
|---|---|
pending |
Execution created but not started |
running |
Execution in progress |
completed |
Execution finished successfully |
failed |
Execution failed with error |
cancelled |
Execution cancelled by user |
aborted |
WCP workflow aborted |
expired |
MAP plan expired before execution |
| Type | Description |
|---|---|
llm_call |
LLM inference call |
tool_call |
External tool invocation |
connector_call |
MCP connector call |
human_task |
Human-in-the-loop task |
synthesis |
MAP result synthesis |
action |
Generic action step |
gate |
WCP policy gate evaluation |
GET /api/v1/executions/{execution_id}GET /api/v1/executions?execution_type=map_plan&status=completed&limit=10