You can call CreateFlowForWeb operation to create a workflow.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. You can use OpenAPI Explorer to search for API operations, call API operations, and dynamically generate SDK sample code.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateFlowForWeb

The operation that you want to perform. This parameter is required for API requests that you create by piecing together HTTP or HTTPS URLs. Set the value to CreateFlowForWeb.

ClusterId String Yes C-A23BD131A862****

The ID of the cluster. You can call ListClusters You can call this operation to view the ID of a cluster.

CreateCluster Boolean Yes false

Indicates whether to create a cluster through the cluster template. ture indicates that a cluster is created through the cluster template. ClusterId should be set to the cluster template ID (CT-xxx) Otherwise, it is the existing cluster ID(C-xxx).

Description String Yes This is the description of a workflow

The description of the workflow.

Name String Yes my_flow_demo

The name of the workflow.

ProjectId String Yes FP-257A173659F5****

The ID of the project. You can call ListFlowProject View the ID of the project.

RegionId String Yes cn-hangzhou

The region ID of the instance. You can call DescribeRegions To view the latest list of Alibaba Cloud regions.

StartSchedule Long No 1538017814000

The start time of the scheduling. It is a long integer timestamp. Example: System.currentTimeMillis () .

  • Must be less than EndSchedule.
  • This item is required when CronExpr is not empty.
EndSchedule Long No 1538018814000

The scheduling failure time, which is a long integer timestamp, for example, System.currentTimeMillis. () .

CronExpr String No 0 0 0-23/1 * * ?

The cron expression of the time-based periodic scheduling.

HostName String No emr-header-1.cluster-123456

The name of the host where the node instance is run. You can call ListFlow Or log on to the host using hostname command to view partition information.

Namespace String No N/A

A reserved parameter.

LogArchiveLocation String No N/A

A reserved parameter.

Lifecycle String No N/A

A reserved parameter.

Graph String No {"nodes":[{"id":"48d474ea","index":0,"spmAnchorId":"0.0.0.i0.766645eb2cmNtQ","attribute":{"type":"START"},"shape":"startControlNode","type":"node","y":250,"size":"80*34","x":500},{"id":"7ba480b3","index":1,"spmAnchorId":"5176.8250060.0.i19.771e28d0IPNQGE","attribute":{"jobType":"SHELL","jobId":"FJ-7BE1062897B19D25","type":"JOB"},"config":{"hostName":""},"label":"fail_job","shape":"shellJobNode","type":"node","y":398.5,"size":"170*34","x":470.5},{"id":"33202d60","index":2,"spmAnchorId":"5176.8250060.0.i23.771e28d0IPNQGE","attribute":{"type":"END"},"shape":"endControlNode","type":"node","y":562.5,"size":"80*34","x":430.5}],"edges":[{"id":"28167ea0","index":3,"source":"48d474ea","sourceAnchor":0,"target":"7ba480b3","targetAnchor":0},{"id":"e8d5ff52","index":4,"source":"7ba480b3","sourceAnchor":1,"target":"33202d60","targetAnchor":0}]}

The DAG graphic information.

AlertConf String No {"items":[{"enable":true,"eventId":"EMR-210401001","alertUserGroupIdList":["AUG-b79bb29bb6e14ddd89674a242623851b"],"alertDingDingGroupList":["ADG-af1f9689d6194e2dbd89927d5c515172"]},{"enable":true,"eventId":"EMR-110401015","alertUserGroupIdList":["AUG-b79bb29bb6e14ddd89674a242623851b"],"alertDingDingGroupList":["ADG-af1f9689d6194e2dbd89927d5c515172"]},{"enable":true,"eventId":"EMR-110401002","alertUserGroupIdList":["AUG-b79bb29bb6e14ddd89674a242623851b"],"alertDingDingGroupList":["ADG-af1f9689d6194e2dbd89927d5c515172"]}]}

The alert notification configurations. eventId can be set to the following alerts:

  • EMR-210401001: indicates that the workflow instance execution failed.
  • EMR-110401002: indicates that the workflow instance execution succeeded.
  • EMR-110401015: indicates that a workflow node failed.
AlertUserGroupBizId String No -

A deprecated parameter.

AlertDingDingGroupBizId String No -

A deprecated parameter.

ParentFlowList String No F-62ECFC6E1BF6EAD2,F-1E6528634E67B615,F-7E0A84332E9D9A89

The parent workflows that the created workflow relies on. Separate the workflows with commas (,). You can call ListFlowInstance View the workflow ID.

ParentCategory String No FC-F2495319DA05****

The ID of the parent directory. You can call DescribeFlowCategory View data on the Member Management page. If not empty, the default is the root directory.

Response parameters

Parameter Type Example Description
Id String F-7A39731FE719****

The ID of the newly created workflow.

RequestId String 243D5A48-96A5-4C0C-8966-93CBF65635ED

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateFlowForWeb
&Description=This is a create workflow Description
&Name=my_flow_demo
&ProjectId=FP-257A173659F5****
&RegionId=cn-hangzhou
&ClusterId=C-A23BD131A862****
&CreateCluster=false
&<common request parameters>

Sample success responses

XML format

<RequestId>2670BCFB-925D-4C3E-9994-8D12F7A9F538</RequestId>
<Id>F-7A39731FE719****</Id>

JSON Syntax

{
    "RequestId": "2670BCFB-925D-4C3E-9994-8D12F7A9F538",
    "Id": "F-7A39731FE719****"
}