Use the time-based schedule feature of Serverless Workflow to periodically run a workflow that invokes a Function Compute (FC) function.
How it works
A time-based schedule triggers a workflow as follows:
-
In Serverless Workflow, you define a task step that invokes a function in Function Compute (FC).
-
In Serverless Workflow, you create a time-based schedule. The schedule then automatically runs the workflow, which executes the function defined in the task step.

Procedure
-
Log on to the Serverless Workflow console.
-
In the top navigation bar, select a region.
-
In the left-side navigation pane, click Application Center.
-
On the Application Center page, click Create Application.
-
On the Create Application page, on the Select Template tab, select the Timer template and click Configure and Deploy.
-
On the Configure and Deploy tab, configure the parameters and click Deploy.
The following table describes the parameters.
Parameter
Description
Application Name
The name of your application. The name must be unique within your Alibaba Cloud account.
NoteYour application is a custom Resource Orchestration Service (ROS) resource. View the resource in the Resource Orchestration Service (ROS) console.
Cron
The cron expression that defines the workflow's schedule. For more information, see Schedule time parameters.
Input
The input for the scheduled workflow. The input must be in JSON format. By default, this field is empty. For more information, see Input format.
After a successful deployment, you can view the application's outputs and resource list on the Overview tab of the application in Application Center. The outputs include applicationName (value: timer) and entrypointFlowName. The resource list shows the six created cloud resources:
ALIYUN::FC::Service,ALIYUN::FNF::Schedule,ALIYUN::FC::Function,ALIYUN::FNF::Flow,ALIYUN::RAM::Role, andALIYUN::RAM::AttachPolicyToRole. All resources have a status of Create Succeeded.-
RAM roles: 'AliyunFCInvocationAccessflowRole' for function invocation and 'flowRole' for the workflow.
-
Function Compute resources: a service named 'service' and a function named 'servicehello'.
-
Serverless Workflow resources: a flow named 'flow' and a time-based schedule (ALIYUN::FNF::Schedule).
-
-
When the creation is complete, click OK to start the flow execution.
-
You are redirected to the Flows page. In the dialog box that appears, specify an Execution Name (optional) and the Input (optional), and then click Start Execution.
-
Execution Name: The name for the execution. It must be 1 to 128 characters long and can contain letters, digits, underscores (_), and hyphens (-). It cannot start with a hyphen (-).
-
Input (optional): The value must be in JSON format.
The following sample is a flow definition that uses a task step to invoke the
hellofunction of Function Compute.version: v1 type: flow steps: # task step to invoke FC function hello - type: task name: hello resourceArn: acs:fc:::services/service-CD946B9A9F36/functions/helloYou can modify the flow definition to implement your business logic. For more information, see Modify a flow.
-