Skip to main content
LangSmith stores each run as a structured record. Understanding this format is useful when exporting traces, querying the API, or building integrations. Here is an example of a JSON representation of a run in the above format:

Run types

The run_type field identifies the kind of operation a span represents. LangSmith uses it to apply appropriate rendering in the trace UI and to enable type-specific features. Set run_type when instrumenting with @traceable or RunTree:
Some run types have specialized trace views in the LangSmith UI:

What is dotted_order?

A run’s dotted order is a sortable key that fully specifies its location within the tracing hierarchy. Take the following example:
If you print out the IDs at each stage, you may get the following:
Note a few invariants:
  • The id is equal to the last 36 characters of the dotted order (the suffix after the final 'Z'). See 0ec6b845-18b9-4aa1-8f1b-6ba3f9fdefd6 for example in the grandchild.
  • The trace_id is equal to the first UUID in the dotted order (i.e., dotted_order.split('.')[0].split('Z')[1])
  • If parent_run_id exists, it is the penultimate UUID in the dotted order. See a8024e23-5b82-47fd-970e-f6a5ba3f5097 in the grandchild, for an example.
  • If you split the dotted_order on the dots, each segment is formatted as (<run_start_time>Z<run_id>)