EventBridge event schedules

Updated at:

An EventBridge event schedule triggers a workflow execution when a specified event reaches CloudFlow. Create a cloud service event schedule to react to events from Alibaba Cloud services, or create a custom event source schedule to react to requests, messages, and logs from your own event sources. This topic describes how to create each type of schedule in the console and how to configure the advanced parameters of a workflow schedule.

Schedule types

EventBridge event schedules fall into two categories:

  • Cloud service event schedules — Use Alibaba Cloud service events to trigger workflow executions. These schedules support almost all official Alibaba Cloud event sources, including elastic computing, storage services, databases, containers, big data processing, observability services, and middleware services. The supported events mainly include CloudMonitor events, audit events, Elastic Compute Service (ECS) events, Alibaba Cloud Internet of Things (IoT) events, and the O&M events of some cloud services.

  • Custom event source schedules — Use your own event sources, such as Simple Log Service (SLS), Kafka, RocketMQ, and RabbitMQ, to trigger workflow executions. The following tabs describe every supported event source.

How it works

A cloud service event schedule runs on an EventBridge event rule that CloudFlow creates for you:

  1. When you submit a request to create a workflow in the workflow console, an event rule named rule-created-by-fnf-<random_string> is automatically created on default, the event bus that Alibaba Cloud dedicates to official cloud service events. The rule is generated from the configuration of the workflow schedule.

  2. After the rule is created, the workflow schedule information appears in the workflow, and the automatically created event rule appears in the EventBridge console.

  3. When an event of the specified type is delivered from the event source to the event bus, the workflow that is associated with the schedule is triggered to execute once.

Limits

The resources that a workflow schedule consumes are subject to the following limits:

  • Event rules on the default event bus — You can create a maximum of 10 event rules on default, the event bus that EventBridge dedicates to cloud services. After the limit of 10 is reached, you can no longer create cloud service event schedules.

  • Custom event buses and event rules — After the number of custom event buses and event rules that you create reaches the upper limit, you can no longer create event-pattern HTTP schedules.

  • Event streams — After the number of event streams that you create reaches the upper limit, you can no longer create event-pattern SMQ, Kafka, RocketMQ, RabbitMQ, SLS, MQTT, or DTS schedules.

    For the limits on the number of resources involved in creating workflow schedules within a single Alibaba Cloud account and a single region, see Limits.

Create an EventBridge schedule

Cloud service schedule

A cloud service schedule uses Alibaba Cloud service events to trigger workflow executions. The following procedure uses an Elastic Compute Service (ECS) event as an example.

Prerequisites

Create a cloud service schedule

  • Log on to the CloudFlow console. In the top navigation bar, select a region.

  • In the left-side navigation pane, click Workflows. On the Workflows page, click the workflow that you want to manage.

  • On the details page of the workflow, click the Workflow Scheduling tab and click Create Workflow Scheduling.

  • - In the Create Workflow Schedule panel, set Scheduling Type to Elastic Compute Service (ECS).

    • Configure the parameters that are described in the following table.

    • Click OK.

    Parameter Description Example
    Name Enter a custom name for the workflow schedule. ecs-schedule
    Event Type Select Custom or All. If you select Custom, you can select one or more Elastic Compute Service event types. Custom, ecs:Disk:ConvertToPostpaidCompleted (Retain Disk)
    Event pattern You cannot edit this parameter. The event pattern is automatically populated after you select an event type for the Event Type parameter. For more information about event patterns, see Event patterns. See the following event pattern.

    The following event pattern is populated for the ecs:Disk:ConvertToPostpaidCompleted event type:

    {
     "source": [
     "acs.ecs"
     ],
     "type": [
     "ecs:Disk:ConvertToPostpaidCompleted"
     ]
    }

    The schedule appears on the Workflow Scheduling tab of the workflow details page, where you can view, edit, delete, enable, or disable it. For information about advanced parameters such as push format, retries, and dead-letter queues, see Advanced scheduling features.

    HTTP schedule

    After HTTP requests are integrated as an event source with EventBridge and CloudFlow, an HTTP schedule can trigger the associated workflow to execute.

    Prerequisites

    Create an HTTP schedule

  • Log on to the CloudFlow console. In the top navigation bar, select a region.

  • In the left-side navigation pane, click Workflows. On the Workflows page, click the workflow that you want to manage.

  • On the details page of the workflow, click the Workflow Scheduling tab and click Create Workflow Scheduling.

    • In the Create Workflow Schedule panel, set Scheduling Type to HTTP/HTTPS Events.

    • Configure the parameters that are described in the following table.

    • Click OK.

    Parameter Description Example
    Name Enter a custom name for the workflow schedule. https-schedule
    Request Type Select HTTPS, HTTP, or HTTP&HTTPS. HTTP
    Request Method Select the supported HTTP request methods. Valid values: - GET - POST - PUT - DELETE - HEAD - PATCH GET
    Security configuration Select the type of security configuration. Valid values: - None: No security configuration is required. All URL requests that are received can trigger workflow executions. - IP CIDR block: Enter a valid IP address or CIDR block. Only URL requests from that IP address or from an IP address within that CIDR block can trigger workflow executions. You can add a maximum of five IP addresses or CIDR blocks. - Secure domain name: Enter the secure domain names. Only URL requests that use these domain names can trigger workflow executions. You can add a maximum of five secure domain names. IP CIDR block: 10.45.12.0/24

    The schedule appears on the Workflow Scheduling tab of the workflow details page, where you can view, edit, delete, enable, or disable it. For information about advanced parameters such as push format, retries, and dead-letter queues, see Advanced scheduling features.

    SMQ schedule

    An SMQ schedule uses the messages in an SMQ queue as the event source to trigger the associated workflow to execute.

    Notes

    • The Simple Message Queue (formerly MNS) queue that serves as the event source must be in the same region as the workflow for which you create the schedule.

    Prerequisites

    Create an SMQ schedule

  • Log on to the CloudFlow console. In the top navigation bar, select a region.

  • In the left-side navigation pane, click Workflows. On the Workflows page, click the workflow that you want to manage.

  • On the details page of the workflow, click the Workflow Scheduling tab and click Create Workflow Scheduling.

  • - In the Create Workflow Schedule panel, set Scheduling Type to Simple Message Queue (formerly MNS).

    • Configure the parameters that are described in the following table.

    • Click OK.

    Parameter Description Example
    Name Enter a custom name for the workflow schedule. smq-schedule
    Queue Name Select an existing queue of Simple Message Queue (formerly MNS). MyQueue
    Base64 Decoding To decode the SMQ data before delivery, select the Enable Base64 Decoding check box. Enable Base64 Decoding

    The schedule appears on the Workflow Scheduling tab of the workflow details page, where you can view, edit, delete, enable, or disable it. For information about advanced parameters such as push format, retries, and dead-letter queues, see Advanced scheduling features.

    Kafka schedule

    A Kafka schedule uses the messages in a topic of an ApsaraMQ for Kafka instance as the event source to trigger the associated workflow to execute.

    Notes

    • The ApsaraMQ for Kafka instance that serves as the event source must be in the same region as the workflow for which you create the schedule.

    Prerequisites

    Create a Kafka schedule

  • Log on to the CloudFlow console. In the top navigation bar, select a region.

  • In the left-side navigation pane, click Workflows. On the Workflows page, click the workflow that you want to manage.

  • On the details page of the workflow, click the Workflow Scheduling tab and click Create Workflow Scheduling.

  • - In the Create Workflow Schedule panel, set Scheduling Type to ApsaraMQ for Kafka.

    • Configure the parameters that are described in the following table.

    • Click OK.

    Parameter Description Example
    Name Enter a custom name for the workflow schedule. kafka-schedule
    ApsaraMQ for Kafka Instance Select an existing ApsaraMQ for Kafka instance. alikafka_pre-cn-i7m2t7t1****
    Topic Select a topic of the existing ApsaraMQ for Kafka instance. topic1
    Group ID Select a Group ID of the existing ApsaraMQ for Kafka instance. Use a dedicated Group ID to create the workflow schedule. Do not share a Group ID with existing services. Otherwise, message sending and receiving of the existing services is affected. GID_group1
    Concurrent consumer tasks The number of concurrent consumers. Valid values: [1, Number of partitions in the topic]. 2
    Consumer Offset Select the consumer offset of messages, which is the position from which ApsaraMQ for Kafka starts to pull messages from the event bus. Valid values: - Earliest Offset: consumes messages from the earliest offset. - Latest Offset: consumes messages from the latest offset. Latest offset
    Network Configuration Select the network type for routing messages. Valid values: - Default Network: uses the VPC ID and vSwitch ID that you selected when you deployed the Kafka instance. - Self-managed Internet: you must select a different VPC, vSwitch, and Security Group. Default Network

    The schedule appears on the Workflow Scheduling tab of the workflow details page, where you can view, edit, delete, enable, or disable it. For information about advanced parameters such as push format, retries, and dead-letter queues, see Advanced scheduling features.

    RocketMQ schedule

    A RocketMQ schedule uses the messages in a topic of an ApsaraMQ for RocketMQ instance as the event source to trigger the associated workflow to execute.

    Notes

    • The ApsaraMQ for RocketMQ instance that serves as the event source must be in the same region as the workflow for which you create the schedule.

    Prerequisites

    Create a RocketMQ schedule

  • Log on to the CloudFlow console. In the top navigation bar, select a region.

  • In the left-side navigation pane, click Workflows. On the Workflows page, click the workflow that you want to manage.

  • On the details page of the workflow, click the Workflow Scheduling tab and click Create Workflow Scheduling.

  • - In the Create Workflow Schedule panel, set Scheduling Type to ApsaraMQ for RocketMQ.

    • Configure the parameters that are described in the following table.

    • Click OK.

    Parameter Description Example
    Name Enter a custom name for the workflow schedule. rocketmq-schedule
    Instance Select an existing ApsaraMQ for RocketMQ instance. MQ_INST_164901546557*_BX7*
    Topic Select a topic of the existing ApsaraMQ for RocketMQ instance. topic1
    Tag Enter a message filter tag. A workflow execution is triggered only when a message that contains the specified filter tag string is received. tag
    Group ID Select a Group ID of the existing ApsaraMQ for RocketMQ instance. (Recommended) Select Quickly Create to automatically create a Group ID in the GID_FNF_TRIGGER_{uuid}_{timestamp} format. Use a dedicated Group ID to create the workflow schedule. Do not share a Group ID with existing services. Otherwise, message sending and receiving of the existing services is affected. GID_group1
    Consumer Offset Select the consumer offset of messages, which is the position from which ApsaraMQ for RocketMQ starts to pull messages from the event bus. Valid values: - Latest Offset: consumes messages from the latest offset. - Earliest Offset: consumes messages from the earliest offset. - Timestamp: consumes messages from a specified timestamp. Latest offset

    The schedule appears on the Workflow Scheduling tab of the workflow details page, where you can view, edit, delete, enable, or disable it. For information about advanced parameters such as push format, retries, and dead-letter queues, see Advanced scheduling features.

    RabbitMQ schedule

    A RabbitMQ schedule uses the messages in a queue of an ApsaraMQ for RabbitMQ instance as the event source to trigger the associated workflow to execute.

    Notes

    • The ApsaraMQ for RabbitMQ instance that serves as the event source must be in the same region as the workflow for which you create the schedule.

    Prerequisites

    Create a RabbitMQ schedule

  • Log on to the CloudFlow console. In the top navigation bar, select a region.

  • In the left-side navigation pane, click Workflows. On the Workflows page, click the workflow that you want to manage.

  • On the details page of the workflow, click the Workflow Scheduling tab and click Create Workflow Scheduling.

    • In the Create Workflow Schedule panel, set Scheduling Type to ApsaraMQ for RabbitMQ.

    • Configure the parameters that are described in the following table.

    • Click OK.

    Parameter Description Example
    Name Enter a custom name for the workflow schedule. rabbitmq-schedule
    ApsaraMQ for RabbitMQ Instance Select an existing ApsaraMQ for RabbitMQ instance. amqp-cn-i7m2l6m2****
    Vhost Select a vhost of the existing ApsaraMQ for RabbitMQ instance. myhost-1
    Queue Select a queue of the existing ApsaraMQ for RabbitMQ instance. myqueue-1

    The schedule appears on the Workflow Scheduling tab of the workflow details page, where you can view, edit, delete, enable, or disable it. For information about advanced parameters such as push format, retries, and dead-letter queues, see Advanced scheduling features.

    SLS schedule

    Create a Simple Log Service (SLS) schedule to connect SLS with CloudFlow. When new logs are generated, a workflow execution is triggered to process the logs.

    Notes

    • The SLS project that serves as the event source must be in the same region as the workflow for which you create the schedule.

    Prerequisites

    Create an SLS schedule

  • Log on to the CloudFlow console. In the top navigation bar, select a region.

  • In the left-side navigation pane, click Workflows. On the Workflows page, click the workflow that you want to manage.

  • On the details page of the workflow, click the Workflow Scheduling tab and click Create Workflow Scheduling.

    • In the Create Workflow Schedule panel, set Scheduling Type to Simple Log Service.

    • Configure the parameters that are described in the following table.

    • Click OK.

    Parameter Description Example
    Name Enter a custom name for the workflow schedule. sls-schedule
    Project Select the SLS project that you created. test-Project
    Logstore Select the SLS Logstore that you created. test-LogStore
    Consumer Offset The offset from which consumption starts. Select the earliest offset or the latest offset, or consume logs from a specified point in time. Latest offset
    RAM Role Authorize EventBridge to use this role to read the log content in SLS. testRole

    The schedule appears on the Workflow Scheduling tab of the workflow details page, where you can view, edit, delete, enable, or disable it. For information about advanced parameters such as push format, retries, and dead-letter queues, see Advanced scheduling features.

    MQTT schedule

    After ApsaraMQ for MQTT is integrated as an event source by using EventBridge with CloudFlow schedules, an ApsaraMQ for MQTT schedule can trigger the associated workflow to execute. Use CloudFlow to perform custom processing on the messages that are published to ApsaraMQ for MQTT.

    Notes

    • The ApsaraMQ for MQTT instance that serves as the event source must be in the same region as the workflow for which you create the schedule.

    Prerequisites

    Create an MQTT schedule

  • Log on to the CloudFlow console. In the top navigation bar, select a region.

  • In the left-side navigation pane, click Workflows. On the Workflows page, click the workflow that you want to manage.

  • On the details page of the workflow, click the Workflow Scheduling tab and click Create Workflow Scheduling.

    • In the Create Workflow Schedule panel, set Scheduling Type to ApsaraMQ for MQTT.

    • Configure the parameters that are described in the following table.

    • Click OK.

    Parameter Description Example
    Name Enter a custom name for the workflow schedule. mqtt-schedule
    MQTT Instance Select an existing MQTT instance. mqtt-xxx
    MQTT topic Select a topic of the existing MQTT instance. testTopic

    The schedule appears on the Workflow Scheduling tab of the workflow details page, where you can view, edit, delete, enable, or disable it. For information about advanced parameters such as push format, retries, and dead-letter queues, see Advanced scheduling features.

    DTS schedule

    After Data Transmission Service (DTS) is integrated as an event source by using EventBridge with CloudFlow, a DTS schedule can trigger the execution of the associated workflow.

    Notes

    • The DTS data subscription task that serves as the event source must be in the same region as the workflow for which you create the schedule.

    Prerequisites

    Create a DTS schedule

  • Log on to the CloudFlow console. In the top navigation bar, select a region.

  • In the left-side navigation pane, click Workflows. On the Workflows page, click the workflow that you want to manage.

  • On the details page of the workflow, click the Workflow Scheduling tab and click Create Workflow Scheduling.

    • In the Create Workflow Schedule panel, set Scheduling Type to Data Transmission Service (DTS).

    • Configure the parameters that are described in the following table.

    • Click OK.

    Parameter Description Example
    Name Enter a custom name for the workflow schedule. dts-schedule
    Data subscription task The name of the data subscription task that you created. dtsqntc2***
    Consumer group The name of the consumer group that you created to consume the subscription task. test
    Account The account that you specified when you created the consumer group. test
    Password The password that you specified when you created the consumer group. * (masked)
    Consumer offset The timestamp of the first data record that you want to consume. The consumer offset must be within the data range of the subscription instance. 2022-06-21 00:00:00

    The schedule appears on the Workflow Scheduling tab of the workflow details page, where you can view, edit, delete, enable, or disable it. For information about advanced parameters such as push format, retries, and dead-letter queues, see Advanced scheduling features.

    Advanced workflow scheduling features

    In addition to the basic parameters of each event source, a workflow schedule provides the following advanced parameters. Configure them when you create or edit the schedule.

    Push format

    The push format specifies the format of each data element in the Event parameter.

    • CloudEvents: a specification that describes event data in a common format. It simplifies event declaration and delivery across services and platforms.

    • RawData: delivers only the content of the data field in a CloudEvent, without the other metadata of the CloudEvents format.

    Batch push

    After you enable batch push, you must set the batch push size and the batch push interval:

    • Batch push size — The maximum number of messages that are sent in a batch by one function invocation. A request is sent only when the number of accumulated messages reaches the specified value. Valid values: [1, 10000].

    • Batch push interval — The interval at which the function is invoked. Each time the interval elapses, the system aggregates the accumulated messages and sends them to CloudFlow. Valid values: [0, 15]. Unit: seconds. A value of 0 specifies that no waiting is required and messages are delivered in real time.

      Whichever condition is met first triggers the push. The following examples show how the two settings interact:
    • Example 1:

      You set the batch push size to 10 messages, the size of each message is 1 KB, and you set the batch push interval to 15s. If 10 messages accumulate within 10s, the batch push size is reached first, so the push is triggered immediately, without waiting until 15s elapses.
    • Example 2:

      You set the batch push size to 32 messages, the size of each message is 1 KB, and you set the batch push interval to 15s. If only 10 messages accumulate when the 15s interval elapses, the batch push interval is reached first, so the system pushes the 10 accumulated messages without waiting until 32 messages accumulate.
    • Example 3:

      You set the batch push size to 20 messages, the size of each message is 2 KB, and you set the batch push interval to 15s. If 40 messages accumulate within 10s, the batch push size is reached before the interval elapses. The first batch aggregates 20 messages and pushes them to CloudFlow. The second batch aggregates the remaining 20 messages and pushes them to CloudFlow.
    Note

    A push is also triggered when the total size of the accumulated messages reaches the size limit for the workflow input. In this case, the system splits the accumulated messages across batches.

    Retry policy

    If an event push fails, the system retries the push based on the configured retry policy. The following retry policies are available.

    • Backoff Retry: retries the push three times. The interval between two retries is a random value between 10s and 20s.

    • Exponential Decay Retry: the default retry policy. Retries the push 176 times over a total retry time of 24 hours. The retry interval increases exponentially up to 512s: the first intervals are 1s, 2s, 4s, 8s, 16s, 32s, 64s, 128s, 256s, and 512s, and each remaining retry uses the maximum interval of 512s.

    Fault tolerance policy

    The fault tolerance policy specifies whether to tolerate faults when an error occurs.

    • Fault Tolerance Allowed

      If a request fails and the retries also fail, the system skips the request and continues to process the next request. You can configure a dead-letter queue only if Fault Tolerance Allowed is enabled.
    • Fault Tolerance Prohibited

      If a request fails and the retries also fail, the consumption task is blocked.

    Dead-letter queue

    A dead-letter queue determines what happens to the messages that a workflow schedule cannot process.

    • If you enable a dead-letter queue, the messages that are not processed or that exceed the maximum number of retries are delivered to a destination service. The destination services that CloudFlow supports include Simple Message Queue (formerly MNS), ApsaraMQ for RocketMQ, ApsaraMQ for Kafka, and EventBridge. Select a queue type based on your requirements.

    • If you do not enable a dead-letter queue, the messages that exceed the maximum number of retries are discarded.