feat(schedules): provide typed accessor to schedule action#1372
Open
chris-olszewski wants to merge 3 commits into
Open
feat(schedules): provide typed accessor to schedule action#1372chris-olszewski wants to merge 3 commits into
chris-olszewski wants to merge 3 commits into
Conversation
379e06c to
02c6dbd
Compare
Sushisource
approved these changes
Jul 6, 2026
| /// Returns the workflow arguments deserialized as the requested type, if present. | ||
| pub async fn args<T: TemporalDeserializable + 'static>( | ||
| &self, | ||
| ) -> Result<Option<T>, PayloadConversionError> { |
Member
There was a problem hiding this comment.
I'm realizing PayloadConversionError variants I didn't really give the best names... encoding errors are smooshed together with conversion errors. We might wanna fix that.
Unrelated to this PR though.
| } | ||
|
|
||
| /// The action configured on this schedule. | ||
| pub fn action(&self) -> ScheduleDescriptionAction { |
Member
There was a problem hiding this comment.
Maybe this should return Option to avoid these expects?
Member
Author
There was a problem hiding this comment.
Is it valid for a schedule to not have an action? I originally had it return an Option, but wasn't sure if None had any meaning other than a malformed schedule. We assume it is always present with in TS: https://typescript.temporal.io/api/namespaces/client#scheduledescription
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
Add
ScheduleDescription::actionto accessScheduleDescriptionActionwithScheduleDescriptionStartWorkflowAction.ScheduleDescriptionStartWorkflowAction::argsprovides typed access to the workflow input.Why?
SDK parity, ergonomics.
Checklist
Closes N/A
How was this tested:
Added unit tests for unhappy path. Updated integration test to verify round trip.
Any docs updates needed?
N/A