Skip to content

feat(sdk): add typed continue as new#1209

Merged
chris-olszewski merged 2 commits intomasterfrom
olszewski/feat_continue_as_new
Apr 10, 2026
Merged

feat(sdk): add typed continue as new#1209
chris-olszewski merged 2 commits intomasterfrom
olszewski/feat_continue_as_new

Conversation

@chris-olszewski
Copy link
Copy Markdown
Member

What was changed

Added continue_as_new helper method to workflow context.

Why?

More ergonomic and enforces correct input type for the workflow.

Checklist

  1. Closes N/A

  2. How was this tested:
    Added small unit tests to verify serialization error gets populated and input threaded through. Updated existing integration tests to use helper method.

  3. Any docs updates needed?
    Updated READMEs

@chris-olszewski chris-olszewski requested a review from a team as a code owner April 10, 2026 00:18
&self,
input: &<W::Run as WorkflowDefinition>::Input,
opts: ContinueAsNewOptions,
) -> Result<std::convert::Infallible, WorkflowTermination>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fun to see Infallible in the OK spot

},
))
ctx.continue_as_new(&(), ContinueAsNewOptions::default())?;
Ok(())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will the compiler let you remove the Ok(()) here because the OK path of CaN is infallible?

Alternatively, writing the can call without the ? as the final statement would make sense to me here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sadly, no

@chris-olszewski chris-olszewski enabled auto-merge (squash) April 10, 2026 18:42
@chris-olszewski chris-olszewski force-pushed the olszewski/feat_continue_as_new branch from 274988a to a94ece4 Compare April 10, 2026 20:35
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.

2 participants