---
title: "Analyze Workflow History with Gemini"
description: "Leverages Google Gemini to analyze Temporal Workflow Histories. Supports JSON format downloaded from the Temporal UX and protobuf format that have been exported to an external bucket."
canonical: "https://temporal.io/code-exchange/analyze-workflow-history-with-gemini.md"
source: "https://temporal.io/code-exchange/analyze-workflow-history-with-gemini"
published: "2025-04-23"
authors:
  - "Rick Ross"
company: "Temporal"
languages:
  - "Python"
tags:
  - "gemini"
  - "ai"
  - "history"
reviewed_by_temporal: false
community_contribution: true
---

# Analyze Workflow History with Gemini

Leverages Google Gemini to analyze Temporal Workflow Histories. Supports JSON format downloaded from the Temporal UX and protobuf format that have been exported to an external bucket.

- [View repo](https://github.com/temporal-sa/temporal-workflow-export-analysis)

Reads Temporal Workflow Histories looking for errors and provides guidance on how to remedy them, leveraging [Google Gemini 2.0 Flash model](https://cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/2-0-flash). 

Identifies these types of issues:

**Failing Activities**
   - Activity Retries > 5
   - Failures due to business reasons

**Failing Workflow Tasks**
   - Bugs in Code
   - Non-Determinism Errors
   - Potential Deadlocks Detected

Here is example output (JSON):

![Analyze Workflow History with Gemini JSON screenshot](https://images.ctfassets.net/0uuz8ydxyd9p/3dEqpFZ0nUfe8JImJ2TaVd/9a1c97721bffaaaa19b6a216003eac56/before.png)

And response from the analyzer:
![Analyze Workflow History with Gemini result](https://images.ctfassets.net/0uuz8ydxyd9p/5HuYYSEfM2o0zok0PXwwKK/94c341e508f0c882bc68b2a251212148/after.png)
