Skip to main content
POST
Test Run Agent

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for POST /agents/test-run.

Carries a full agent config + a sample record. The BE runs the record through the agent (LLM + tools) without touching Flink and returns the timeline so the FE can show what happened.

config
CreateAgentConfigRequest · object
required

Full agent config under test

sampleRecord
Samplerecord · object
required

One Kafka-shaped record to feed the agent

agentId
string | null

Resolves an empty / masked apiKey against the stored agent's encrypted blob. Post-cutover the wizard sends apiKey: '' for every existing-agent test-run; this lets the BE swap in the stored key for legacy inline-key agents that were saved before the Connection cutover (no llmConnectionId to resolve via).

Maximum string length: 64
savedConnectionId
string | null

Mirror of the ValidateLlmRequest.savedConnectionId path.

Maximum string length: 64
skipTools
boolean
default:false

When true, every MCP / HTTP tool dispatch returns a canned {skipped: true} payload to the LLM. Use to iterate on prompt shape without burning real tool calls.

Response

Successful Response

Response body for POST /agents/test-run.

steps
TestRunStep · object[]
required
stoppedReason
enum<string>
required
Available options:
completed,
max_iterations,
error,
timeout
iterationsUsed
integer
required
tokensIn
integer
required
tokensOut
integer
required
durationMs
integer
required
finalOutput
any
approximations
string[]

Free-form list of caveats, e.g. 'memory_excluded', 'transforms_skipped'.

suggestions
TestRunSuggestion · object[]

Deterministic hints (max 4) computed from the agent config + run result. Empty when the run produced a useful structured output. Each suggestion has a stable kind the FE can map to icon / copy.

warnings
TestRunWarning · object[]

Static config-vs-record checks (e.g. memory keyField missing on the sample) that the Flink runtime would silently swallow at deploy. Empty when nothing is amiss.

outputSchemaCheck
TestRunSchemaCheck · object | null

Field-level diff between the declared output.schema and the LLM's finalOutput. Null when no schema was declared OR the run errored / produced a non-structured (text envelope) result. ok=true means every declared field is present with a compatible type.

systemPrompt
string | null

Composed system prompt the LLM actually received - base template + auto-injected schema fields + tool descriptions + customInstructions. Identical to what Flink sends at deploy time (built by the same build_system_prompt). Null when the run errored before reaching the LLM (e.g. llm_resolution_error).

userMessage
string | null

First user message dispatched to the LLM, after the prompts.user template wraps the (input-fields-filtered) sample record. Lets the test pane show the exact pair of strings the LLM saw on iteration 1. Null when the run errored before message construction.

error
TestRunError · object | null

Structured error envelope on a failed test-run.