Skip to content

[Fix #1177] Add read property to schedule.on - #1178

Merged
ricardozanini merged 3 commits into
open-workflow-specification:mainfrom
ricardozanini:fix/1177-schedule-on-read
Jul 29, 2026
Merged

[Fix #1177] Add read property to schedule.on#1178
ricardozanini merged 3 commits into
open-workflow-specification:mainfrom
ricardozanini:fix/1177-schedule-on-read

Conversation

@ricardozanini

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a read property to the schedule definition as a sibling of on
  • Allows users to choose how consumed events are read when a workflow is triggered by events (data, envelope, or raw)
  • Defaults to data, making this a non-breaking change
  • Mirrors the existing listen.read property for consistency

Example

schedule:
  on:
    one:
      with:
        type: com.example.order-placed
  read: envelope

Fixes #1177

Add a read property to the schedule definition as a sibling of
the on property, allowing users to choose how consumed events
are read when a workflow is triggered by events. Supports data,
envelope, and raw values, defaulting to data.

This is consistent with the listen task's read property and is
non-breaking since existing workflows without read continue to
work with the default behavior.

Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
Copilot AI review requested due to automatic review settings July 29, 2026 19:19
@ricardozanini
ricardozanini requested a review from cdavernas as a code owner July 29, 2026 19:19

Copilot AI 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.

Pull request overview

This PR extends the workflow scheduling schema and documentation to allow configuring how events are materialized into workflow inputs when a workflow is triggered via schedule.on, aligning behavior with the existing listen.read option.

Changes:

  • Adds schedule.read to the JSON schema with data|envelope|raw and default data.
  • Documents the new schedule.read property in the DSL reference.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
schema/workflow.yaml Adds schedule.read schema property (enum + default) to control event reading mode for event-triggered schedules.
dsl-reference.md Documents schedule.read and its supported values/default.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread schema/workflow.yaml
Use dependentRequired to ensure that the read property can only
be specified when the on property is also present, since read is
only meaningful for event-triggered schedules.

Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
Copilot AI review requested due to automatic review settings July 29, 2026 19:30

Copilot AI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

schema/workflow.yaml:159

  • The schema property name is schedule.read, but the title is ScheduleOnReadAs, which implies the property is nested under on. For consistency with other schedule property titles (e.g., ScheduleCron, ScheduleOn), consider renaming this title to reflect the actual property (ScheduleReadAs).
        title: ScheduleOnReadAs

@cdavernas cdavernas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! Cheers ❤️

Comment thread dsl-reference.md Outdated
Clarify in the DSL reference that setting read without on MUST
be considered invalid by the runtime.

Signed-off-by: Ricardo Zanini <ricardozanini@gmail.com>
Copilot AI review requested due to automatic review settings July 29, 2026 19:47

@cdavernas cdavernas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

Copilot AI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

schema/workflow.yaml:159

  • The title for the schedule.read property breaks the naming pattern used by other schedule properties (ScheduleEvery, ScheduleCron, ScheduleAfter, ScheduleOn). Since the property name is read, using ScheduleOnReadAs is inconsistent and may make schema validation messages confusing.
        title: ScheduleOnReadAs

schema/workflow.yaml:160

  • The schedule.read schema duplicates the exact same enum/default as listen.read. To avoid divergence over time, consider extracting this into a shared $defs schema (e.g., eventReadAs) and referencing it from both schedule.read and listen.read.
      read:
        type: string
        enum: [ data, envelope, raw ]
        default: data
        title: ScheduleOnReadAs
        description: Specifies how consumed events are read when the workflow is triggered by events. Supported values are 'data' (reads the event's data), 'envelope' (reads the event's envelope, including context attributes), and 'raw' (reads the event's raw data). Defaults to 'data'.

@ricardozanini
ricardozanini merged commit 4d42471 into open-workflow-specification:main Jul 29, 2026
3 checks passed
@ricardozanini
ricardozanini deleted the fix/1177-schedule-on-read branch July 29, 2026 22:41
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.

Schedule.on does not allow selecting between Cloud data or envelope

3 participants