dhiaayachi / temporal

Temporal service
https://docs.temporal.io
MIT License
0 stars 0 forks source link

Add TemporalScheduledStartTime and TemporalScheduledById to the NewWorkflowExecutionInfo message #54

Open dhiaayachi opened 2 months ago

dhiaayachi commented 2 months ago

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

dhiaayachi commented 1 month ago

Thank you for your feature request!

Adding TemporalScheduledStartTime and TemporalScheduledById to the NewWorkflowExecutionInfo message would be a great way to make it easier to validate the originating starter for Workflows started by a schedule.

However, this is a feature that is not currently available. We are currently working on improving the way we handle schedules and hope to add this functionality in the future.

In the meantime, you could try using a custom search attribute to store the schedule information. This is not ideal as it could be spoofed, but it might be a temporary workaround.

dhiaayachi commented 1 month ago

Thank you for your feature request.

This is a great idea for making schedules more powerful and secure. Currently there isn't a direct way to do this with Temporal, but you could consider the following workarounds.

  1. Use a custom activity: You could write a custom activity that retrieves the schedule information from the Temporal service and stores the schedule information in the workflow state.
  2. Use a custom marker: You could record a custom marker in the workflow history at the time the workflow is started via the schedule. This marker could include the schedule details and workflow ID.

We'll consider your suggestion for a future release.

dhiaayachi commented 1 month ago

Thank you for reporting this feature request! This is a great idea. We're always looking for ways to improve Temporal and provide more robust features for our users.

Currently, this feature is not available in the Temporal .NET SDK, but you can use Search Attributes as a workaround. You can add fields to your Workflow Execution for the originating starter and ID, which can be queried.

We will keep this feature request in mind for future development.