Open dhiaayachi opened 2 months ago
A user is looking for a way to validate the originating starter for Workflows started by a schedule. Currently, using Search Attributes is problematic because:
We would like to add the following fields to the NewWorkflowExecutionInfo
message to provide information about the scheduled Workflow start:
TemporalScheduledStartTime
: The time at which the schedule was created to start the Workflow. TemporalScheduledById
: The ID of the schedule that triggered the Workflow.The user has already considered using Search Attributes, but found it problematic for the reasons mentioned above.
Adding these fields to NewWorkflowExecutionInfo
would provide a more secure and reliable way to track the origins of scheduled Workflows. This would be helpful for a variety of use cases, such as:
This feature could be implemented as part of the existing Schedule functionality. The TemporalScheduledStartTime
and TemporalScheduledById
fields could be added to the Schedule information and propagated to the NewWorkflowExecutionInfo
message when a Workflow is started by a schedule.
For reference, you can check out the existing NewWorkflowExecutionInfo
message structure here.
Thank you for your feature request!
This is a great idea and we appreciate you bringing it to our attention. It would be really helpful to be able to validate the originating starter for WFs started by a schedule.
For now, as a workaround, you can use a custom search attribute for your scheduled workflows. You can set this search attribute to the ID of the starter that triggered the workflow. You can then query for workflows using this search attribute to identify the originating starter.
We will consider adding this feature to our future releases.
Thank you for your feature request.
We understand the need to validate the originating starter for WFs started by a schedule. While adding TemporalScheduledStartTime
and TemporalScheduledById
to the NewWorkflowExecutionInfo
message is a good idea, it requires a change to Temporal's core functionality and is not currently on our roadmap.
In the meantime, you can work around this limitation by:
schedule-
to clearly identify workflows started by a schedule.We appreciate your feedback and will keep it in mind as we plan future enhancements to Temporal.
Thanks for reporting this! It looks like you are asking for a feature request to add the ability to query by schedule. Currently, this feature is not available.
As a workaround, you can try using search attributes, however, you mentioned that it might not be ideal for you.
You are welcome to create a GitHub issue for this feature request so we can discuss this further.
Thank you for the feature request!
Adding TemporalScheduledStartTime
and TemporalScheduledById
to the NewWorkflowExecutionInfo
message would be a valuable addition for workflows started by schedules. This would allow users to more easily identify and filter workflows based on their originating schedule.
While we are currently not working on implementing this feature, you can work around this limitation by using Search Attributes to store information about the originating schedule.
Here are some points to keep in mind:
We appreciate your feedback and will consider your suggestion for future enhancements.
Thank you for the feature request!
While Temporal does not currently support directly including the originating scheduler ID and start time within the NewWorkflowExecutionInfo
message, you can achieve a similar outcome using Search Attributes.
You mentioned concerns about spoofing and timestamp-based WFIDs. To address those:
By carefully crafting your search attributes, you can effectively identify and verify the source of workflow executions triggered by schedules.
Is your feature request related to a problem? Please describe. A user would like to validate the originating starter for WFs started by a schedule. Using Search Attributes is problematic. The ideal solution is to add a similar field for cron, cron_schedule, for Schedules.
Describe the solution you'd like We would like to add TemporalScheduledStartTime and TemporalScheduledById to the NewWorkflowExecutionInfo message
Describe alternatives you've considered The user tried using Search Attributes but found them problematic for 2 reasons:
Additional context