[Fix #1177] Add read property to schedule.on - #1178
Conversation
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>
There was a problem hiding this comment.
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.readto the JSON schema withdata|envelope|rawand defaultdata. - Documents the new
schedule.readproperty 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.
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>
There was a problem hiding this comment.
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 isScheduleOnReadAs, which implies the property is nested underon. For consistency with otherscheduleproperty titles (e.g.,ScheduleCron,ScheduleOn), consider renaming this title to reflect the actual property (ScheduleReadAs).
title: ScheduleOnReadAs
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>
There was a problem hiding this comment.
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
titlefor theschedule.readproperty breaks the naming pattern used by otherscheduleproperties (ScheduleEvery,ScheduleCron,ScheduleAfter,ScheduleOn). Since the property name isread, usingScheduleOnReadAsis inconsistent and may make schema validation messages confusing.
title: ScheduleOnReadAs
schema/workflow.yaml:160
- The
schedule.readschema duplicates the exact same enum/default aslisten.read. To avoid divergence over time, consider extracting this into a shared$defsschema (e.g.,eventReadAs) and referencing it from bothschedule.readandlisten.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'.
4d42471
into
open-workflow-specification:main
Summary
readproperty to thescheduledefinition as a sibling ofondata,envelope, orraw)data, making this a non-breaking changelisten.readproperty for consistencyExample
Fixes #1177