# Log every CircleCI build to a Google Sheet automatically

> Automatically record every finished CircleCI workflow in a Google Sheet, building a durable build-history log you can filter, pivot, and chart.

- Workflow type: code
- Services: CircleCI, Google Sheets
- Categories: Engineering, Operations
- Published: 2026-07-17

## What it does

- Adds a new row to your Google Sheet every time a build finishes in CircleCI, whether it passed, failed, or was canceled.
- Captures the project, workflow name, branch, status, duration, and the time it finished so nothing gets lost.
- Builds a permanent build-history log you can keep well beyond CircleCI's 90-day reporting window.
- Gives you clean, structured data to pivot, filter, and chart for build-health and DORA-style engineering reports.

## What you'll need

- A CircleCI account with access to the project whose builds you want to track
- A Google account and a Google Sheet to store the build log
- A tab in that sheet with column headers for project, workflow, branch, status, duration, and finish time

## Prompt

Run this automatically every time a CircleCI workflow finishes on my project, whether it succeeded, failed, or was canceled. Use the CircleCI workflow-completed poll trigger (event type workflow_completed) so the workflow fires exactly once per completed run, with no missed runs and no duplicates.

When a workflow completes, take the workflow ID from the trigger payload and call CircleCI's Get a workflow operation to read its full details: the workflow name, the branch it ran on (from the pipeline), its final status, its start timestamp (created_at) and stop timestamp (stopped_at), and the project slug. Compute the build duration from the start and stop timestamps (stopped_at minus created_at).

Then append one new row to my Google Sheet build-history log using the Append Values operation. Map the columns in this order: project (the CircleCI project slug), workflow name, branch, status, duration, and timestamp (use the stop timestamp, the moment the workflow finished). Use valueInputOption USER_ENTERED so timestamps and durations are stored as real dates and numbers I can pivot and chart, and append after the last row of the existing table so the header row stays intact. I will provide the spreadsheet ID and the tab/range to append to.

This must run deterministically on every completed workflow with no summarization, filtering, or judgement: one finished workflow always produces exactly one appended row. Log every terminal status equally (success, failed, canceled, and any other final state) so the sheet becomes a complete, durable build-history log I can filter, pivot, and chart for build-health reporting and DORA-style metrics like deployment frequency and change failure rate. This is the raw data layer that a weekly AI report or a BI dashboard can later sit on top of.

## How to customize

- Point it at a different Google Sheet or tab to keep separate logs per project or team.
- Add or reorder the columns you capture, such as the pipeline number or who triggered the build.
- Optionally narrow it to specific branches, like main or release branches, if you only care about those.

## Example output

New spreadsheet row: Project: gh/acme/api | Workflow: build-and-deploy | Branch: main | Status: success | Duration: 3m 42s | Finished: 2026-07-17 15:42

## FAQ

### Does this log failed and canceled builds too, or only successful ones?

It logs every finished workflow no matter the outcome, so passed, failed, and canceled builds all get their own row.

### Why not just use CircleCI's built-in reporting?

CircleCI's Insights only keep about 90 days of history. This gives you a permanent record in your own spreadsheet that you can keep forever and analyze however you like.

### Will it create duplicate rows for the same build?

No. Each finished workflow adds exactly one row, so your log stays clean and accurate.

### Do I need to write any code?

No. Once it is connected to your CircleCI project and your Google Sheet, it runs on its own every time a build finishes.

### Can I use this data for DORA metrics?

Yes. Because it captures status, duration, and timestamps for every build, it is an ideal raw data layer for tracking things like deployment frequency and change failure rate.

Use this prompt in General Input: https://www.generalinput.com/prompts/log-every-circleci-build-to-a-google-sheet-automatically