Skip to content

(workflows): update rollback context types#6807

Open
vaishnav-mk wants to merge 3 commits into
mainfrom
vaish/workflows-rollback-context-types
Open

(workflows): update rollback context types#6807
vaishnav-mk wants to merge 3 commits into
mainfrom
vaish/workflows-rollback-context-types

Conversation

@vaishnav-mk

Copy link
Copy Markdown
Contributor

Adds ctx: WorkflowStepContext to WorkflowRollbackContext and removes legacy stepName. Updates generated type snapshots and RPC type tests.

@vaishnav-mk vaishnav-mk requested review from a team as code owners June 12, 2026 13:25
@vaishnav-mk vaishnav-mk requested a review from james-elicx June 12, 2026 13:25
@ask-bonk

ask-bonk Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

All snapshots are consistent with the source definition. The changes are straightforward and correct:

  1. stepName: string removed from WorkflowRollbackContext
  2. ctx: WorkflowStepContext added to WorkflowRollbackContext
  3. Generated snapshots updated consistently
  4. Type tests updated to verify the new shape

The WorkflowStepContext type already contains step.name (as part of step: { name: string; count: number }) along with attempt and config, so users still have access to the step name via ctx.step.name - strictly more information than the old stepName string. The type tests cover both overloads of workflowStep.do().

This is a clean, well-scoped type change with no issues.

LGTM

github run

@petebacondarwin petebacondarwin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this horse has already left the stable, but won't removing this property break users of Workflows?

Comment thread types/defines/rpc.d.ts
ctx: WorkflowStepContext;
error: Error;
output: T | undefined;
stepName: string;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not a breaking change to users?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the plan is to remove stepName for end users. We intend to continue supporting it internally for a while, providing the names specifically for the identified users who still rely on it. However, we want to discourage the use of stepName in favour of using ctx directly as it offers better compatibility with the rest of our features. wdyt? cc: @avenceslau

@petebacondarwin petebacondarwin removed the request for review from james-elicx June 15, 2026 08:17
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.

3 participants