Skip to main content
The history API captures every Stagehand operation for debugging, auditing, and workflow analysis.

Basic Usage

History Entry Structure

Common Use Cases

Debugging Failures

Analyzing Timing

Operation Statistics

Saving History

Filtering by Operation Type

Combining with Metrics

Observability Guide

Learn more about metrics, logging, and monitoring

What’s Tracked?

Only Stagehand methods are tracked in history:

Best Practices

  • Save history for critical workflows - Maintain audit trails for production
  • Inspect history when debugging - Check the last operations to identify failures
  • Analyze timing periodically - Find slow operations and optimize
  • Combine with metrics - Get complete visibility into performance and cost

Next Steps

Deterministic Agent

Build fast, cached agent workflows

Observability

Combine history with metrics

Caching

Speed up workflows with caching

Logging

Configure detailed execution traces