Skip to content

feat(openworkflow): persist step indices across workflow replays - #789

Merged
jamescmartinez merged 1 commit into
mainfrom
step-index
Sep 20, 2026
Merged

jamescmartinez merged 1 commit into
mainfrom
step-index

Conversation

@jamescmartinez

Copy link
Copy Markdown
Contributor

Prerequisite to #624.

@greptile-apps

greptile-apps Bot commented Sep 20, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with stable replay indexing and backward-compatible handling of historical attempts.

Summary

This PR persists a zero-based invocation index on each step attempt so indices remain stable when concurrent branches replay in a different execution order.

  • Adds nullable step_index columns through PostgreSQL and SQLite migrations.
  • Extends backend creation and retrieval paths to persist and expose the index.
  • Assigns indices synchronously during step-name resolution and restores persisted indices during replay.
  • Adds coverage for concurrent ordering, retries, legacy attempts, and both backend contracts.
Diagram
sequenceDiagram
  participant W as Workflow
  participant H as StepHistory
  participant E as StepExecutor
  participant B as Backend

  W->>H: resolveStepName(baseName)
  alt persisted step name
    H->>H: restore persisted index
  else new step name
    H->>H: assign next available index
  end
  H-->>W: resolved step name
  W->>E: invoke resolved step
  E->>H: stepIndex(resolvedName)
  H-->>E: stable invocation index
  E->>B: createStepAttempt(name, index)
  B-->>E: persisted StepAttempt
Loading

Reviews (1) · Last reviewed commit: "feat(openworkflow): persist step indices..."

@jamescmartinez
jamescmartinez enabled auto-merge (squash) September 20, 2026 21:49
@pkg-pr-new

pkg-pr-new Bot commented Sep 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/openworkflowdev/openworkflow/@openworkflow/cli@789
npm i https://pkg.pr.new/openworkflowdev/openworkflow/@openworkflow/dashboard@789
npm i https://pkg.pr.new/openworkflowdev/openworkflow@789

commit: 29bea14

@codecov

codecov Bot commented Sep 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jamescmartinez
jamescmartinez merged commit 58ad82e into main Sep 20, 2026
11 checks passed
@jamescmartinez
jamescmartinez deleted the step-index branch September 20, 2026 21:51
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