Reference

BatchStepResult

Type
One result from an executeStepBatch response: output or an error, per step.

One entry in executeStepBatch's results, in the same order as the input steps. A step that succeeded carries output and billingCost; a step that failed carries error instead, so one failure does not sink the batch. Check for error per entry rather than assuming every step produced output.

BatchStepResult.ts
interface BatchStepResult {
  stepType: string
  output?: Record<string, unknown>
  billingCost?: number
  error?: string
}
Fields
stepType
string
The action that was executed.
output
object
The action's output. Present on success.
billingCost
number
Cost of this step in nanodollars. Present on success.
error
string
Error message. Present when this step failed.
Handle per-step results
const { results } = await mindstudio.executeStepBatch(steps);
for (const r of results) {
  if (r.error) console.warn(r.stepType, 'failed:', r.error);
  else use(r.output);
}