# LangSmith (/integrations/langsmith)





{/* MANUAL-CONTENT-START:intro */}

Use [LangSmith](https://www.langchain.com/langsmith) to record workflow, tool, or model runs with inputs, outputs, tags, metadata, and parent-child relationships. Create or update runs, retrieve a run, and attach feedback using the actions below.

{/* MANUAL-CONTENT-END */}

## Use the block [#usage-instructions]

Send run data to LangSmith to trace executions, attach metadata, and monitor workflow performance.

## Actions [#actions]

### LangSmith Create Run [#langsmith-create-run]

Forward a single run to LangSmith for ingestion.

<ReferenceDetails>
  #### Input [#input]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | LangSmith API key |
  | `id` | string | No | Unique run identifier |
  | `name` | string | Yes | Run name |
  | `run_type` | string | Yes | Run type (tool, chain, llm, retriever, embedding, prompt, parser) |
  | `start_time` | string | No | Run start time in ISO-8601 format |
  | `end_time` | string | No | Run end time in ISO-8601 format |
  | `inputs` | json | No | Inputs payload |
  | `run_outputs` | json | No | Outputs payload |
  | `extra` | json | No | Additional metadata (extra) |
  | `tags` | json | No | Array of tag strings |
  | `parent_run_id` | string | No | Parent run ID |
  | `trace_id` | string | No | Trace ID |
  | `session_id` | string | No | Session ID |
  | `session_name` | string | No | Session name |
  | `status` | string | No | Run status |
  | `error` | string | No | Error details |
  | `dotted_order` | string | No | Dotted order string |
  | `events` | json | No | Structured events array |

  #### Output [#output]

  | Parameter | Type | Description |
  | - | - | - |
  | `accepted` | boolean | Whether the run was accepted for ingestion |
  | `runId` | string | Run identifier provided in the request |
  | `message` | string | Response message from LangSmith |
</ReferenceDetails>

### LangSmith Create Runs Batch [#langsmith-create-runs-batch]

Forward multiple runs to LangSmith in a single batch.

#### Input [#input-1]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `apiKey` | string | Yes | LangSmith API key |
| `post` | json | No | Array of new runs to ingest |
| `patch` | json | No | Array of runs to update/patch |

#### Output [#output-1]

| Parameter | Type | Description |
| - | - | - |
| `accepted` | boolean | Whether the batch was accepted for ingestion |
| `runIds` | array | Run identifiers provided in the request |
| `message` | string | Response message from LangSmith |
| `messages` | array | Per-run response messages, when provided |

### LangSmith Update Run [#langsmith-update-run]

Patch an existing LangSmith run with outputs, status, or timing once it completes.

#### Input [#input-2]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `apiKey` | string | Yes | LangSmith API key |
| `runId` | string | Yes | ID of the run to update |
| `name` | string | No | Corrected run name |
| `end_time` | string | No | Run end time in ISO-8601 format |
| `outputs` | json | No | Outputs payload |
| `extra` | json | No | Additional metadata (extra) |
| `tags` | json | No | Array of tag strings |
| `status` | string | No | Run status |
| `error` | string | No | Error details |
| `events` | json | No | Structured events array |

#### Output [#output-2]

No output fields are documented for this action.

### LangSmith Get Run [#langsmith-get-run]

Retrieve a single LangSmith run by ID.

#### Input [#input-3]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `apiKey` | string | Yes | LangSmith API key |
| `runId` | string | Yes | ID of the run to retrieve |

#### Output [#output-3]

| Parameter | Type | Description |
| - | - | - |
| `id` | string | Run ID |
| `runId` | string | Run ID (alias of id, for consistency with other operations) |
| `name` | string | Run name |
| `runType` | string | Run type (tool, chain, llm, retriever, embedding, prompt, parser) |
| `status` | string | Run status |
| `startTime` | string | Run start time (ISO) |
| `endTime` | string | Run end time (ISO) |
| `inputs` | json | Run inputs payload |
| `outputs` | json | Run outputs payload |
| `error` | string | Error details, if the run failed |
| `tags` | array | Tags attached to the run |
| `sessionId` | string | Project (session) ID the run belongs to |
| `traceId` | string | Trace ID |
| `parentRunId` | string | Parent run ID |
| `totalTokens` | number | Total tokens consumed by the run |
| `totalCost` | string | Total cost of the run |

### LangSmith Create Feedback [#langsmith-create-feedback]

Attach a score, correction, or comment to a LangSmith run.

#### Input [#input-4]

| Parameter | Type | Required | Description |
| - | - | - | - |
| `apiKey` | string | Yes | LangSmith API key |
| `runId` | string | Yes | ID of the run to attach feedback to |
| `key` | string | Yes | Feedback metric name (e.g. "correctness", "user\_score") |
| `score` | number | No | Numeric score for the feedback metric |
| `value` | string | No | Categorical value for the feedback metric |
| `comment` | string | No | Free-text comment explaining the feedback |
| `correction` | json | No | Corrected output for the run |
| `feedbackSourceType` | string | No | Origin of the feedback (api, app, or model) |

#### Output [#output-4]

| Parameter | Type | Description |
| - | - | - |
| `id` | string | Feedback ID |
| `key` | string | Feedback metric name |
| `runId` | string | ID of the run the feedback was attached to |
| `score` | number | Score recorded for the feedback |
| `value` | string | Categorical value recorded for the feedback |
| `comment` | string | Comment recorded for the feedback |
| `createdAt` | string | When the feedback was created (ISO) |
