Scenario
Scenario defines a complete test case for a workflow. A scenario provides simulated events that mock external interactions (LLM calls, tool executions) and expectations that verify the workflow behaves correctly. Example - Basic LLM response test:Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name uniquely identifies this scenario. Required. |
apiVersion | string | No | ApiVersion specifies the schema version. Optional, for future compatibility. |
description | string | No | Description documents what this scenario tests. |
events | SimulatedEvent[] | Yes | Events lists the simulated events in execution order. Required. |
expect | Expectation | No | Expect defines the expected outcome and assertions. Optional. |
inputs | object | No | Inputs overrides workflow inputs for this scenario. Optional. |
start_at | string | No | StartAt begins execution at a specific node instead of the entry point. Optional. |
state | map[string]object | No | State pre-populates node outputs before execution. Optional. |
SimulatedEvent
SimulatedEvent represents a single mocked event in a test scenario. Events target specific nodes and provide mock outputs. There are two modes:- Raw output mode: Set Output directly with the activity’s output structure
- Typed mode: Set Type with typed fields (text, tool_calls, tool_output)
- node: call_llm
- node: agent_loop.call_llm
- name: bash
- node: agent_loop.execute_tools
- node: custom_node
Fields
| Field | Type | Required | Description |
|---|---|---|---|
node | string | No | Node targets a specific node using dot-notation for qualified IDs. |
output | object | No | Output is the raw mock output (mutually exclusive with Type). |
type | string | No | Type specifies the event type for automatic conversion. |
text | string | No | Text is the LLM response text (for type: llm_response). |
tool_calls | SimToolCall[] | No | ToolCalls are tool invocations from the LLM (for type: llm_response). |
tool | string | No | Tool is the tool name (for type: tool_result or tool_error). |
tool_output | object | No | ToolOutput is the tool execution result (for type: tool_result). |
SimToolCall
SimToolCall represents a tool call in a simulated LLM response. Example:Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name is the tool name (e.g., “bash”, “search”, “edit”). |
input | object | No | Input contains the tool’s input parameters. |
Expectation
Expectation defines what to verify after a scenario runs. All fields are optional - specify only what you want to assert. Node references support qualified IDs for inner loop nodes. Example - Assert completion and reached nodes:Fields
| Field | Type | Required | Description |
|---|---|---|---|
outcome | string | No | Outcome specifies whether the workflow should complete or error. |
reached | string[] | No | Reached lists nodes that must be scheduled during the scenario (completed, skipped, or errored). |
not_reached | string[] | No | NotReached lists nodes that must NOT be scheduled during the scenario. |
completed | string[] | No | Completed lists nodes that must have executed successfully. |
skipped | string[] | No | Skipped lists nodes that must have been skipped due to a false condition. |
error_contains | string | No | ErrorContains specifies a substring that should appear in the error message. |
error_node | string | No | ErrorNode specifies which node should produce the error. |
node_outputs | map[string]object | No | NodeOutputs specifies expected output values for specific nodes. |
Targeting Nodes
Thenode field on events targets specific nodes by ID:
- Top-level nodes:
node: "call_llm" - Inner loop nodes:
node: "loop_id.inner_node_id"(dot-separated) - Inner workflow nodes:
node: "workflow_id.inner_node_id"(fortype: workflowwithinline:) - Nested structures:
node: "outer.inner.node_id"
- Events with a
nodefield are matched to that specific node - Events without a
nodefield are consumed sequentially in order - Multiple events with the same node are consumed in order per-node (use for multi-iteration loops)
Event Types
| Type | Description | Required Fields |
|---|---|---|
llm_response | Simulate LLM returning text and/or tool_calls | text or tool_calls |
tool_result | Simulate tool returning output | tool, tool_output |
tool_error | Simulate tool error | tool, tool_output (with error) |
llm_error | Simulate LLM error | output (with error structure) |
user_input | Simulate user message | text |