Log every CircleCI build to a Google Sheet automatically

By General Input

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

Integrations

  • CircleCI
  • Google Sheets

Type

Deterministic Code

Categories

  • Engineering
  • Operations

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.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seatsBuild audience segments from product usage and push to LoopsTurn the people who engage with your posts into Pipedrive leads