Skip to main content
Mastra 1.0 is available 🎉 Read announcement

dataset.listExperimentResults()

Added in: @mastra/core@1.4.0

Lists individual item results for a specific experiment with pagination.

Usage example
Direct link to Usage example

import { Mastra } from "@mastra/core";

const mastra = new Mastra({ /* storage config */ });

const dataset = await mastra.datasets.get({ id: "dataset-id" });

const { results, pagination } = await dataset.listExperimentResults({
experimentId: "exp-id",
page: 0,
perPage: 50,
});

for (const result of results) {
console.log(`Item ${result.itemId}: ${result.error ? "FAILED" : "OK"}`);
}

Parameters
Direct link to Parameters

experimentId:

string
ID of the experiment to list results for.

page?:

number
Page number. Defaults to `0`.

perPage?:

number
Number of results per page. Defaults to `20`.

Returns
Direct link to Returns

result:

Promise<object>
Paginated experiment results.
object

results:

ExperimentResult[]
Array of item-level results.
ExperimentResult

id:

string
Unique result ID.

experimentId:

string
ID of the parent experiment.

itemId:

string
ID of the dataset item.

itemDatasetVersion:

number | null
Dataset version of the item when executed.

input:

unknown
Input data passed to the target.

output:

unknown | null
Output from the target.

groundTruth:

unknown | null
Expected output.

error:

{ message: string; stack?: string; code?: string } | null
Structured error if execution failed.

startedAt:

Date
When execution started.

completedAt:

Date
When execution completed.

retryCount:

number
Number of retry attempts.

traceId:

string | null
Trace ID for observability.

createdAt:

Date
When the result record was created.

pagination:

PaginationInfo
Pagination metadata with `total`, `page`, `perPage`, and `hasMore`.
On this page