Help Center> FunctionGraph> User Guide> Getting Started> Creating a Workflow Trigger

Creating a Workflow Trigger

This section describes how to create a workflow trigger and orchestrate it in a workflow using the trigger URN.

Creating an SMN Trigger

Before creating an SMN trigger, apply for the SMN service and create a topic (for example, the graph-test topic) on the SMN console. For details, see Creating a Topic.

  1. Log in to the FunctionGraph console, and choose Workflows > Workflow Triggers.
  2. Click Create Trigger.
  3. In the Create Trigger dialog box, configure the trigger information, as shown in Table 1. The parameters with an asterisk (*) are mandatory.

    Table 1 SMN workflow trigger information

    Parameter

    Description

    *Trigger Name

    Name of the trigger, which can contain a maximum of 32 characters. Only letters, digits, and hyphens (-) are allowed.

    Enter trigger_smn.

    Description

    Description of the trigger, which can contain a maximum of 256 characters.

    In this example, leave the description blank.

    *Event Source

    Select SMN.

    *Topic Name

    Name of an SMN topic.

    Select graph-test.

  1. Click OK.

    A trigger URN is generated, for example, urn:fgs:southchina:b8c3784c7a464100aea6dc8fedc15911:trigger:SMN_test_trigger-smn8d1a4147-e45a-4923-41f5-6a2f3de8853e_1508227863.

Creating an OBS Trigger

Before creating an OBS trigger, apply for the OBS service and create a bucket (for example, the obs-cff bucket) on the OBS console. For details, see Creating a Bucket.

  1. Log in to the FunctionGraph console, and choose Workflows > Workflow Triggers.
  2. Click Create Trigger.
  3. In the Create Trigger dialog box, configure the trigger information, as shown in Table 2. The parameters with an asterisk (*) are mandatory.

    Table 2 OBS workflow trigger information

    Parameter

    Description

    *Trigger Name

    Name of the trigger, which can contain a maximum of 32 characters. Only letters, digits, and hyphens (-) are allowed.

    Enter trigger_obs.

    Description

    Description of the trigger, which can contain a maximum of 256 characters.

    In this example, leave the description blank.

    *Event Source

    Select OBS.

    *Bucket

    OBS bucket to be used as the event source.

    Select obs-cff.

    *Events

    Events for triggering a workflow or a state of the workflow.

    Select Put, Post, and Delete. When files are updated, uploaded, or deleted in the obs_cff bucket, the workflow or state is triggered.

    Prefix

    Keyword for limiting notifications to those about objects whose names start with the matching characters. This limit can be used to filter the names of OBS objects. In this example, leave this field blank.

    Suffix

    Keyword for limiting notifications to those about objects whose names end with the matching characters. This limit can be used to filter the names of OBS objects. In this example, leave this field blank.

  1. Click OK.

    A trigger URN is generated, for example, urn:fgs:southchina:b8c3784c7a464100aea6dc8fedc15911:trigger:OBS_obs-cff_trigger-86504a09a43b-077d-4726-69f9-2a51b7cce384_1512031172.