Skip to content

feat(automations): Record the Automation version on each run - #2212

Merged
dcramer merged 1 commit into
mainfrom
feat/automation-run-version
Oct 23, 2026
Merged

dcramer merged 1 commit into
mainfrom
feat/automation-run-version

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

After an Automation is edited, we could not tell which instruction an earlier run used, or who saved that instruction. junior_automation_runs stored the Automation id, but not the version.

This adds a nullable automation_version column and a foreign key to junior_automation_versions. When a run is dispatched, the column is set to the newest version whose stored definition equals the dispatched definition. That is the same rule the active version uses. Later writes, such as completion, keep the value.

  • Scheduled automations set it when the run is marked dispatched, using the task that the heartbeat dispatched.
  • Event automations set it when the run is recorded as started.
  • The column is null for runs that never dispatched, for runs from before this change, and in the rare case where the event start write failed and settlement inserts the row.

The definition is matched with jsonb equality, not "newest version", so an edit that lands between the dispatch and the run write does not get attributed to the wrong version.

First step of #2211.

via David Cramer.

--

View Junior Session [Sentry]

Store the version that a Scheduled or event automation run dispatched, so a
reader can see which instruction ran and who saved it after later edits.

Refs #2211

Co-Authored-By: David Cramer <david@sentry.io>
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Oct 23, 2026 7:26am UTC

Request Review

@dcramer
dcramer merged commit 269f60a into main Oct 23, 2026
45 checks passed

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 51573cd4 Deployed Oct 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant