Skip to content

Flows: support scheduling derived flow processes #1586

@zaychenko-sergei

Description

@zaychenko-sergei

Currently we provide limited ways to initiate derived flow processes like EXECUTE_TRANSFORM and WEBHOOK_DELIVER (on dataset change):

  • manual trigger (by user)
  • reactive trigger:
    • upstream flow completed and updated one of the watched input datsets
    • there has been a push event in one of the watched input datasets

Reactive triggers do allow configuring batching rules to minimize the number of activations, in particular, number of input records to accumulate and a batching deadline, so that the arrived data does not wait forever:

Image

However, when the input activations are intensive (such as IoT devices), and the transformation is expensive, it might be preferable to choose batching style of updates, such as once per day or once per hour.

So, derived flow processes should be allowed to have a schedule as an alternative to reactive trigger.
If there are no input updates, that would create an "Up-To-Date" result.

  1. For EXECUTE_TRANSFORM datasets:
  • update validation rules inside setTrigger API to support scheduled triggers
type DatasetFlowTriggersMut {
  setTrigger(
         datasetFlowType: DatasetFlowType!,
         triggerRuleInput: FlowTriggerRuleInput!,
         triggerStopPolicyInput: FlowTriggerStopPolicyInput!
       ): SetFlowTriggerResult!
      ...
  • update logic of schedule/sensors handling, so that no sensor is registered, and schedule ticks can initiate transform flows
  • support changes in UI, including:
    • Settings page (allow scheduling or reactive rules)
    • Ensure flow history for transform flows displays the scheduled activation causes properly
  1. For WEBHOOK_DELIVER (might go with a separate ticket):
  • implement Webhooks: reliable delivery of missed dataset updates #1342 first

  • extend APIs that create and update webhook subscriptions:

     type DatasetWebhooksMut {
    createSubscription(input: WebhookSubscriptionInput!): CreateWebhookSubscriptionResult!
        ...
     }
    
     type WebhookSubscriptionMut {
    update(input: WebhookSubscriptionInput!): UpdateWebhookSubscriptionResult!
         ...
      }
    
      input WebhookSubscriptionInput {
    targetUrl: URL!
    eventTypes: [WebhookEventType!]!
    label: WebhookSubscriptionLabel!
        // <<< This needs to support schedules and/or reactive rules
      }
    
    
  • extend APIs that read this state back (type WebhookSubscription { ... })

  • update logic of schedule/sensors handling, similarly to transform

  • support changes in UI, including:

    • Settings page (allow scheduling or reactive rules)
    • Ensure flow history for transform flows displays the scheduled activation causes properly

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrustPull requests that update Rust code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions