LangWatch Evaluation icon

LangWatch Evaluation

Check if evaluating, record results, run and record evaluators; optionally set outputs to dataset (auto writes to dataset only when not running from a dataset/batch).

Record Result

AI-generated

Summary

Record an evaluation result JSON to the LangWatch batch context without executing the evaluator.

Inputs

  • result — Evaluation result JSON (supports expressions). Provide evaluator output to record. Example: {metric: custom, passed: true, score: 0.9, inputs: {input: {{$json.input}}, output: {{$json.output}}}. If this node also runs the evaluator, you do not need to fill this.. Default: {}. Type: json.
  • runId — Override the run ID. By default, this is inferred from upstream dataset/evaluation context (_langwatch.batch.runId). Placeholder: {{ $json._langwatch?.batch?.runId || $json.runId }}. Type: string.

Output shape

Output 1: Items augmented with _langwatch.recorded: true and _langwatch.lastEvaluation set to the provided result JSON. Output 2: Empty array.

The node returns [modified_items, []]. Each modified item retains original JSON fields and adds _langwatch metadata.

Examples

Example 1: Record a custom metric result

Set result to {metric: custom, passed: true, score: 0.9} and leave runId blank to infer from batch context.

Discussion