Create a Run
Start executing a new Run
A Run can be started with an initial prompt (human
message).
Options
initialPrompt
An initial prompt for the run (human
message) .
name
A human readable name for the run, this will be shown in the Runs pane of the Playground.
If none is provided, one will be generated automatically based on the initialPrompt
.
agentId
If the configuration should be inherited from an Agent.
input
A structured input object which is merged with the initialPrompt
. If the run specifies an Agent with an inputSchema, this will be validated against that schema.
resultSchema
By default, a Run’s result object shape is at the discretion of the model. A specific output structure can be enforced by providing a resultSchema
value in JSON Schema form.
The Run will be forced to return a result in the provided format or null
if this is not possible.
onStatusChange
As an alternative to retrieving a Run result via the API or calling the SDK’s poll()
function, you can provide an Inferable function as a handler which will be called each time the status of the run changes.
Using an onStatusChange
handler to receive Run results provides the same durability guarantees as any other Inferable function, this is especially helpful in the case of Runs which may take some time to complete or pause for approval.
When registering an onStatusChange
handler via the SDK, the function must accept an object in the correct format.
Each SDK provides a helper type for registering the onStatusChange
handler
attachedFunctions
By default, a Run will have access to all functions within the cluster (including the Standard Library, you can explicitly attach a set of desired functions by setting the attachedFunctions
property.
tags
Key-Value tags which can be attached to the run. Runs are queryable by these values using the API.
Tags are useful for maintaining a relation between Inferable Runs and entities within your systems, for example, attaching an orderId
to Runs.
context
Context object which is passed to all calls in the Run. This can be used to vary the behavior of functions in a Run, for example based on a timezone
value.
These values are not made available to the model. To do so, add them in the
initialPrompt
, systemPrompt
or input
.
The values provided are available within a function’s second argument which also contains any authContext
returned from default.handleCustomAuth.
reasoningTraces
When enabled, the Run will produce a reasoning
trace for each function call.
Defaults to true.
callSummarization
When enabled, the Run will attempt to auto-summarize functionr results that are too large (>10k characters) to include in the agent context.
Defaults to false.
interactive
When disabled, the run will not allow additional messages to be added.
Defaults to true.
Headers
Path Parameters
Body
The agent ID to use
An array of functions to make available to the run. By default all functions in the cluster will be available
Enable summarization of oversized call results
Additional context to propogate to all Jobs in the Run
Enable result grounding
An initial 'human' message to trigger the run
Structured input arguments to merge with the initial prompt. The schema must match the agent input schema if defined
Allow the run to be continued with follow-up messages / message edits
The model identifier for the run
claude-3-5-sonnet
, claude-3-haiku
The name of the run, if not provided it will be generated
Mechanism for receiving notifications when the run status changes
Enable reasoning traces
A JSON schema definition which the result object should conform to. By default the result will be a JSON object which does not conform to any schema
The run ID. If not provided, a new run will be created. If provided, the run will be created with the given
A system prompt for the run.
Run tags which can be used to filter runs
When provided, the run will be marked as as a test / evaluation
Response
The id of the newly created run
Was this page helpful?