Skip to content

feat(schedules): provide typed accessor to schedule action#1372

Open
chris-olszewski wants to merge 3 commits into
mainfrom
olszewski/schedule_describe_input_args
Open

feat(schedules): provide typed accessor to schedule action#1372
chris-olszewski wants to merge 3 commits into
mainfrom
olszewski/schedule_describe_input_args

Conversation

@chris-olszewski

Copy link
Copy Markdown
Member

What was changed

Add ScheduleDescription::action to access ScheduleDescriptionAction with ScheduleDescriptionStartWorkflowAction. ScheduleDescriptionStartWorkflowAction::args provides typed access to the workflow input.

Why?

SDK parity, ergonomics.

Checklist

  1. Closes N/A

  2. How was this tested:
    Added unit tests for unhappy path. Updated integration test to verify round trip.

  3. Any docs updates needed?
    N/A

@chris-olszewski chris-olszewski requested a review from a team as a code owner July 5, 2026 16:20
@chris-olszewski chris-olszewski force-pushed the olszewski/schedule_describe_input_args branch from 379e06c to 02c6dbd Compare July 6, 2026 13:42
/// Returns the workflow arguments deserialized as the requested type, if present.
pub async fn args<T: TemporalDeserializable + 'static>(
&self,
) -> Result<Option<T>, PayloadConversionError> {

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.

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 {

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.

Maybe this should return Option to avoid these expects?

@chris-olszewski chris-olszewski Jul 6, 2026

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.

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

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