Workflow Runtime ================ Source: ``examples/workflow/workflow_runtime.py`` Introduction ------------ Human-AI collaboration by design motivates transparent orchestration boundaries, AutoGen motivates composable multi-component execution, and HELM motivates repeatable runtime instrumentation for comparisons. This example is the minimal workflow-runtime build for observing step execution semantics directly. Technical Implementation ------------------------ 1. Configure ``Tracer`` with JSONL + console output so each run emits machine-readable traces and lifecycle logs. 2. Build the runtime surface (public APIs only) and execute ``Workflow.run(...)`` with a fixed ``request_id``. 3. Capture structured outputs from runtime execution and preserve termination metadata for analysis. 4. Print a compact JSON payload including ``trace_info`` for deterministic tests and docs examples. .. mermaid:: flowchart LR A["Input prompt or scenario"] --> B["main(): runtime wiring"] B --> C["Workflow.run(...)"] C --> D["WorkflowRuntime schedules step graph (LogicStep)"] C --> E["Tracer JSONL + console events"] D --> F["ExecutionResult/payload"] E --> F F --> G["Printed JSON output"] .. literalinclude:: ../../../examples/workflow/workflow_runtime.py :language: python :lines: 51- :linenos: Expected Results ---------------- .. rubric:: Run Command .. code-block:: bash PYTHONPATH=src python3 examples/workflow/workflow_runtime.py Example output shape (values vary by run): .. code-block:: text { "success": true, "final_output": "", "terminated_reason": "", "error": null, "trace": { "request_id": "", "trace_dir": "artifacts/examples/traces", "trace_path": "artifacts/examples/traces/run__.jsonl" } } References ---------- - `Human-AI collaboration by design `_ - `AutoGen `_ - `Holistic Evaluation of Language Models (HELM) `_