You can call this operation to create a workflow.

Request parameters

Name Type Required Example Description
Description String Yes "This is a workflow description." The description of the workflow.
Name String Yes my_flow_demo The name of the workflow.
ProjectId String Yes FP-257A173659F59685 The ID of the project.
RegionId String Yes cn-hangzhou The ID of the region.
AlertDingDingGroupBizId String No This is a legacy parameter. The ID of the DingTalk group to send alerts.
AlertUserGroupBizId String No This is a legacy parameter. The ID of the user group to send alerts.
ClusterId String Yes C-A23BD131A862F184 The ID of the cluster.
CreateCluster Boolean Yes false Indicates whether to create a cluster.
  • A value of true indicates that a cluster is created using the cluster template. The format of the ClusterID value is CT-XXXXXX.
  • A value of false indicates an existing cluster is used. The format of the ClusterID value is C-XXXXXX.
CronExpr String No 0 0 0-23/1 * * ? The expression of Cron.
EndSchedule Long No 1538018814000 Indicates when to end the schedule.
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 description of the DAG.
HostName String No emr-header-1.cluster-123456 The information of the host on which the workflow is run.
ParentCategory String No FC-F2495319DA05CEE5 The ID of the parent category.
ParentFlowList String No [F-123456] The list of the parent flows.
StartSchedule Long No 1538017814000 Indicates when to start the schedule.

Response parameters

Name Type Example Description
RequestId String 243D5A48-96A5-4C0C-8966-93CBF65635ED The ID of the request.
Id String F-7A39731FE7196358 The ID of the workflow that has been created.

Examples

  • Sample requests
    /? Description="This is a workflow description."
    &Name=my_flow_demo
    &ProjectId=FP-257A173659F59685
    &RegionId=cn-hangzhou 
    &AlertDingDingGroupBizId=AUG-c917bbfaf6494bbfacdee69c8284967c
    &AlertUserGroupBizId=ADG-0a00d00abb7743ff9f812f1a997f3d87
    &ClusterId=C-A23BD131A862F184
    &CreateCluster=false
    &CronExpr=0 0 0-23/1 * * ?
    &EndSchedule=1538018814000
    &Graph={"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}]}
    &HostName=emr-header-1.cluster-123456
    &ParentCategory=FC-F2495319DA05CEE5
    &ParentFlowList=[F-123456]
    &StartSchedule=1538017814000
    &<Common request parameters>
  • Successful response examples
    JSON format
    {
        "Id":"F-7A39731FE7196358",
        "RequestId":"2670BCFB-925D-4C3E-9994-8D12F7A9F538"
    }
  • Error response examples
    JSON format
    {
        "code":"FLOW_API_FAILED",
        "message":"Invalid type [INVALID_TYPE]",
        "requestId":"11BAFBD8-8509-4177-A26D-407505E73713",
        "successResponse":false
    }

Error codes

View error codes.