Skip to main content
These methods read a single run or build a link to one. To migrate run queries, see Query runs. For deprecation dates and minimum SDK versions, see Migrate to SmithDB-backed SDK methods.

Runs: retrieve

Fetch a single run by ID. Returns only the run ID by default—specify a field selection list to retrieve additional data.

Main changes

Method name

client.runs.retrieve() is now async. Call it with await.
See the reference for the full parameter and field list.

Query parameters

runs.retrieve requires a new project_id field that read_run did not need. It also accepts an optional start_time—providing it speeds up retrieval but is not required.

Response fields

Pass SCREAMING_SNAKE_CASE strings to selects (eg. "ID", "NAME", "STATUS") to control which fields are populated on the returned Run; only selected fields are non-None. Default selects contains only "ID".

Examples

Fetch a single run by ID

runs.retrieve requires an additional project_id (UUID) parameter that read_run did not need. It also accepts an optional start_time—providing it speeds up retrieval but is not required. Resolve the project UUID via client.aread_project() first.
Before

Selecting fields

read_run returns a full run object with no selection needed. runs.retrieve returns only id by default—pass selects=[...] to request more.
Before

Handle a not-found run

read_run raised LangSmithNotFoundError from langsmith.utils for a missing run. runs.retrieve raises NotFoundError from langsmith instead.
Before

Load a run’s child runs

The load_child_runs flag and the nested child_runs field are removed. Fetch every run in the trace with traces.list_runs, then filter on parent_run_ids, which holds each run’s full ancestor chain, root first and closest parent last.
Replace read_run(run_id, load_child_runs=True) with client.traces.list_runs.
Before

Runs: get URL

Get the LangSmith UI URL for a run.

Main changes

Method name

client.runs.get_url() is now async. Call it with await.
See the reference for the full parameter list.

Parameters

runs.get_url needs the run’s project_id and trace_id passed directly, instead of resolving them from a run object or a project_name/project_id fallback.

Response

Examples

Get a run’s URL

get_run_url accepts a full run object. runs.get_url is async and needs the run’s project_id (its session_id under the old v1 schema) and trace_id passed individually, with start_time optional.
Before

See also