server icon indicating copy to clipboard operation
server copied to clipboard

Create a set_flow_schedule graphql mutation

Open anthonyfong100 opened this issue 4 years ago • 3 comments

Current behavior

Currently, there are no graphql mutations to provide creating a schedule for a given flow at run time (after the flow has been created). Instead, we need to either

  1. use the graphql update_flow end point
  2. use the graphql set_flow_group_schedule

Proposed behavior

Introduce a set_flow_schedule into the graphql mutation into the graphql endpoint.

Example

This enhancement would be very useful so that we can save the schedules all in the flow information and it is more convenient.

anthonyfong100 avatar Oct 05 '20 11:10 anthonyfong100

Hi @anthonyfong100 - this is precisely what set_flow_group_schedule is for; is there a reason that route doesn't work for your use case? We don't want to introduce a way of altering the ground-truth of the Flow configuration that was registered (that way we can always revert back to user's code configuration if needed), hence the introduction of Flow Groups.

cicdw avatar Oct 05 '20 16:10 cicdw

hi @cicdw I understand where you are coming from. However, i feel like setting it on the flow group might not be as suitable as storing all the schedules on the flow:

  1. It is not as intuitive to set on flow group and not on flow and might be error prone when just starting out (Listing a flow schedule required one to check both flow and flow group schedule)

Is it possible to instead store and additional flag in the schedule object like for e.g. base_schedule: true. This allows all the schedule information to be stored at the same place making it less error prone

anthonyfong100 avatar Oct 06 '20 01:10 anthonyfong100

The issue you describe sounds like an issue of documentation - we should make sure users understand how Flows and Flow Groups interact, along with the implications for database queries, but I don't see a benefit to adding a third way of altering a Flow's schedule that has its own unique failure modes (e.g., schedule changes won't persist across re-registrations).

cicdw avatar Oct 06 '20 02:10 cicdw