创建工作流参数及示例

请求参数

参数 类型 是否必选 示例值 描述
Description String 这是一个创建工作流描述 工作流描述
Name String my_flow_demo 工作流名称
ProjectId String FP-257A173659F59685 项目ID
RegionId String cn-hangzhou 区域
AlertDingDingGroupBizId String 已过期 报警钉钉群信息
AlertUserGroupBizId String 已过期 报警用户组信息
ClusterId String C-A23BD131A862F184 集群 ID
CreateCluster Boolean false 是否创建集群
  • 为 true 时, ClusterId 为集群模板ID CT-XXXXXX
  • 为false时, ClusterId 为现有集群 ID C-XXXXXX
CronExpr String 0 0 0-23/1 * * ? cron 表达式
EndSchedule Long 1538018814000 结束调度时间
Graph String {"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}]} dag 图形信息
HostName String emr-header-1.cluster-123456 指定运行的机器信息, 格式为 emr-header-1.cluster-123456
ParentCategory String FC-F2495319DA05CEE5 父目录 ID
ParentFlowList String [F-123456] 依赖的父工作流列表
StartSchedule Long 1538017814000 开始调度时间

返回参数

字段 类型 示例值 描述
RequestId String 243D5A48-96A5-4C0C-8966-93CBF65635ED 请求 ID
Id String F-7A39731FE7196358 创建成功的工作流 ID

示例

  • 请求示例
    /?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
    &<公共请求参数>
  • 正常返回示例
    JSON 格式
    {
    	"Id":"F-7A39731FE7196358",
    	"RequestId":"2670BCFB-925D-4C3E-9994-8D12F7A9F538"
    }
  • 异常返回示例
    JSON 格式
    {
    	"code":"FLOW_API_FAILED",
    	"message":"Invalid type [INVALID_TYPE]",
    	"requestId":"11BAFBD8-8509-4177-A26D-407505E73713",
    	"successResponse":false
    }

错误码

查看本产品错误码