Skip to content

fix(workflows): name the workflow storage transactions - #30

Draft
NathanFlurry wants to merge 2 commits into
mainfrom
fix-name-workflow-transactions
Draft

NathanFlurry wants to merge 2 commits into
mainfrom
fix-name-workflow-transactions

Conversation

@NathanFlurry

@NathanFlurry NathanFlurry commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Problem

RivetKit 3.1's SQLite profiler logs a warning for each transaction shape that has no static name:

level=warn message="SQLite transaction is unnamed. Add a static `name` to group transaction, storage, and commit performance across executions. Individual statement profiling remains available." fingerprint=shape-…

Release-style workflows log "SQLite transaction is unnamed" on every step's storage write, because WorkflowStorage.batch() in src/rivetkit/driver.ts calls db.transaction() without a name. These are the package's only transaction() calls.

Change

  • Name both driver transactions: workflow-batch-state for live step writes committed with actor state (experimental.includeState), and workflow-batch for control writes. The driver tests now assert the options passed to db.transaction().
  • ci(release): the publish workflow now passes --prerelease to gh release create when the version has a semver prerelease suffix (for example 1.1.2-rc.1). Previously, release candidates were created as full GitHub releases. npm dist-tag handling is unchanged.

Limitation: RivetKit must accept a name for state transactions

In RivetKit 3.1.1 (and 3.1.2-rc.1), db.transaction(cb, { experimental: { includeState: true } }) calls beginStateTransaction(timeout, scope) and drops options.name. The native state transaction takes no name either. This PR passes the name anyway, so it takes effect once RivetKit forwards it; no further change is needed here.

RivetKit's own actor bootstrap transactions are also unnamed and log the same warning once for each new actor, independent of this package.

Verification

I ran a minimal RivetKit 3.1.1 app with one workflow() actor running three steps, and traced each driver transaction against the profiler output:

Transaction 1.1.1 this branch
control write (workflow-batch) unnamed warning named (identity=workflow-batch), no warning
step writes (workflow-batch-state, includeState) unnamed warning per new shape unnamed warning per new shape (name dropped by RivetKit)
RivetKit actor bootstrap unnamed warning unnamed warning

Because a 1-row control write and a 1-row step write share a shape, the total warning count in this small app is unchanged until RivetKit forwards the state-transaction name.

  • pnpm lint, pnpm format:check, pnpm check:boundaries, pnpm check-types, pnpm test:e2e, pnpm build and pnpm verify:pack pass locally, and CI passes.
  • Locally, tests/compat/upgrade.test.ts > pending-sleep fails identically on main when the full suite runs on a loaded machine, and passes in isolation and in CI. The compat runner's Date.now advances on every call, so extra clock reads under load shift the persisted timestamps.

🤖 Generated with Claude Code

NathanFlurry and others added 2 commits November 16, 2026 02:48
RivetKit's SQLite profiler logs "SQLite transaction is unnamed" for each
transaction shape that has no static name, so release-style workflows log
it on their step storage writes. Name the driver's two transactions so the
profiler can group their transaction, storage and commit performance
across executions:

- `workflow-batch-state`: live step writes committed with actor state
- `workflow-batch`: control writes

RivetKit 3.1.1 applies the name to `workflow-batch` today. It does not yet
forward `name` for `experimental.includeState` transactions, so step
writes keep logging the warning until RivetKit passes the name through.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The publish workflow created every GitHub release as a full release, so
release candidates such as `1.0.0-rc.1` showed as regular releases and
could take the "Latest" badge. Pass `--prerelease` when the version has a
semver prerelease suffix. npm dist-tags are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
npm — 2e47430a Deployed Nov 16, 2026 by NathanFlurry via publish #9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant