Bulk export handles the full pipeline: discover conversations in your LangSmith project, export the complete run trees (including child LLM and tool runs), parse into Trajectories, and upload to the Trajectory platform.
Prerequisites
Before running a bulk export, you need three pieces of information from LangSmith:
- API key — your LangSmith API key (starts with
lsv2_sk_... or lsv2_pt_...)
- Workspace ID — the tenant/workspace UUID
- Destination ID — a pre-configured bulk export destination UUID
Finding your Workspace ID
- Go to LangSmith and open Settings (gear icon)
- Under Workspaces, select your workspace
- The workspace ID is in the URL:
https://smith.langchain.com/o/.../workspaces/{workspace_id}
Alternatively, you can find it via the API:
Finding your Destination ID
A bulk export destination tells LangSmith where to write the exported data (e.g. a GCS bucket). Destinations are configured in the LangSmith UI:
- Go to Settings → Bulk Exports in LangSmith
- Create or select an export destination (e.g. a GCS bucket)
- Copy the destination ID
You can also list existing destinations via the API:
Finding your Project ID
- Go to your project in LangSmith
- The project ID is in the URL:
https://smith.langchain.com/o/.../projects/p/{project_id}
E2E Bulk Export
With all three IDs, the full pipeline is three lines:
What happens under the hood
-
Discover trace IDs — lists all root runs in the project and collects their
trace_id values. This is necessary because child runs (LLM calls, tool calls) don’t carry thread_id metadata, so filtering by thread ID alone would miss them.
-
Trigger bulk export — sends a
POST to the LangSmith bulk exports API with an in(trace_id, [...]) filter, which captures the full run tree for each conversation (parents and all children).
-
Poll for completion — the export job runs asynchronously. The SDK polls every 5 seconds until it completes (typically 1-2 minutes).
-
Download parquet — fetches the exported parquet file from the configured GCS destination bucket.
-
Parse into Trajectories — groups runs by
conversation_id (from metadata) or trace_id, builds run trees, extracts messages, and constructs Trajectory objects using multiprocessing for speed.
Time-Scoped Export
Export only recent conversations by passing the since parameter:
You can also pass an absolute datetime:
When since is omitted, the SDK exports all conversations in the project.
From a Local Parquet File
If you already have a parquet file (e.g. from a previous export or manual download), you can skip the export steps:
No workspace_id or destination_id is needed when providing a local file.
Upload
After importing, upload trajectories to the Trajectory platform:
trajectory_api_key must be set in tj.init() (or via the TRAJECTORY_API_KEY env var) for upload to work.
Limits and Caveats
- The LangSmith bulk export API has a maximum of 100 runs per page when listing root runs. The SDK auto-paginates through all pages.
- Export jobs are asynchronous and typically take 1-2 minutes to complete.
- The
destination_id must point to a GCS bucket that your service account can read from.
- Empty conversations (root runs with no child LLM/tool runs) produce Trajectories with 0 steps. The upload step automatically skips these.