创建一个流程。
接口说明
接口说明
每个用户所能创建的流程个数受资源限制(详见使用限制),如果您有特殊需求,可以提工单进行调整。
流程在用户级别是按照名称来区分的,即单一账号下不可以存在同名流程。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
fnf:CreateFlow |
create |
*Flow
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| Name |
string |
是 |
流程名称。该名称在同一地域内唯一,创建后不可修改。取值说明如下:
|
my_flow_name |
| Definition |
string |
是 |
流程定义,遵循 Flow Definition Language (FDL)语法标准。考虑到向前兼容,当系统支持两种规范的流程定义规范。 说明
以上流程定义示例中 Name:my_flow_name 是指流程名称,需和入参 Name 保持一致 |
旧版: " type: flow version: v1 name: my_flow_name steps: - type: pass name: mypass " 新版: " Type: StateMachine SpecVersion: v1 Name: my_flow_name StartAt: my_state States: - Type: Pass Name: my_state End: true " |
| Description |
string |
是 |
流程描述。 |
my test flow |
| Type |
string |
是 |
流程类型,取值:FDL。 枚举值:
|
FDL |
| RoleArn |
string |
否 |
流程执行依赖的授权角色资源描述符信息。用于在执行流程时,Serverless 工作流服务扮演该角色(AssumeRole)操作相关的流程资源。 |
acs:ram:${region}:${accountID}:${role} |
| ExternalStorageLocation |
string |
否 |
外部存储位置。 |
/path |
| ExecutionMode |
string |
否 |
执行模式,枚举类型,可以是 Express 和 Standard;考虑到向前兼容,空串等价于 Standard 执行模式。 枚举值:
|
Standard |
| Environment |
object |
否 |
配置 Flow 执行期间可以访问的环境信息 |
|
| Variables |
array<object> |
否 |
配置 Flow 执行期间可以访问的环境变量列表 |
|
|
object |
否 |
配置 Flow 执行期间可以访问的变量列表 |
||
| Name |
string |
否 |
变量名称 |
key |
| Value |
string |
否 |
变量值 |
value |
| Description |
string |
否 |
变量描述 |
description |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回数据。 |
||
| Type |
string |
流程类型。 枚举值:
|
FDL |
| Definition |
string |
流程定义,考虑到向前兼容,当系统支持两种规范的流程定义规范。 |
旧版: "type: flow\nversion: v1\nname: my_flow_name\nsteps:\n - type: pass\n name: mypass" 新版: "Type: StateMachine\nSpecVersion: v1\nName: my_flow_name\nStartAt: my_state\nStates:\n - Type: Pass\n Name: my_state\n End: true" |
| RoleArn |
string |
流程执行依赖的授权角色资源描述符信息。用于在执行流程时,Serverless 工作流服务扮演该角色(AssumeRole)操作相关的流程资源。 |
acs:ram:${region}:${accountID}:${role} |
| RequestId |
string |
请求 ID。当有 |
testRequestID |
| Description |
string |
流程描述信息。 |
my test flow |
| Name |
string |
流程名称。 |
my_flow_name |
| CreatedTime |
string |
流程创建时间。 |
2019-01-01T01:01:01.001Z |
| LastModifiedTime |
string |
流程最近一次的更改时间。 |
2019-01-01T01:01:01.001Z |
| Id |
string |
流程的唯一标识。 |
e589e092-e2c0-4dee-b306-3574ddfdddf5**** |
| ExecutionMode |
string |
执行模式,枚举类型,可以是 Express 和 Standard,考虑到向前兼容,该字段可能为空字符串,这种情况等价于 Standard 模式。 |
Standard |
| Environment |
object |
Flow 执行期间可以访问的变量列表 |
|
| Variables |
array<object> |
Flow 执行期间可以访问的变量列表 |
|
|
object |
Flow 执行期间可以访问的变量列表 |
||
| Name |
string |
变量名称 |
key |
| Value |
string |
变量值 |
value |
| Description |
string |
变量描述 |
description |
示例
正常返回示例
JSON格式
{
"Type": "FDL",
"Definition": "旧版:\n\"type: flow\\nversion: v1\\nname: my_flow_name\\nsteps:\\n - type: pass\\n name: mypass\"\n\n新版:\n\"Type: StateMachine\\nSpecVersion: v1\\nName: my_flow_name\\nStartAt: my_state\\nStates:\\n - Type: Pass\\n Name: my_state\\n End: true\"",
"RoleArn": "acs:ram:${region}:${accountID}:${role}",
"RequestId": "testRequestID",
"Description": "my test flow",
"Name": "my_flow_name",
"CreatedTime": "2019-01-01T01:01:01.001Z",
"LastModifiedTime": "2019-01-01T01:01:01.001Z",
"Id": "e589e092-e2c0-4dee-b306-3574ddfdddf5****",
"ExecutionMode": "Standard",
"Environment": {
"Variables": [
{
"Name": "key",
"Value": "value",
"Description": "description"
}
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | ActionNotSupported | The requested API operation '%s' is incorrect. Please check. | |
| 400 | APIVersionNotSupported | The requested API version '%s' is not supported yet. Please check. | |
| 400 | EntityTooLarge | The payload size exceeds maximum allowed size (%s bytes). | 请求消息体过大。 |
| 400 | InvalidArgument | Parameter error. | 请求参数错误。具体内容请参考实际错误信息。 |
| 400 | MissingRequiredHeader | The HTTP header '%s' must be specified. | 请求所需参数缺失。具体内容请参考实际错误信息。 |
| 400 | MissingRequiredParams | The HTTP query '%s' must be specified. | 请求所需参数缺失。具体内容请参考实际错误信息。 |
| 500 | InternalServerError | An internal error has occurred. Please retry. | 服务器内部错误。请稍后重试。 |
| 403 | AccessDenied | The resources doesn't belong to you. | |
| 403 | InvalidAccessKeyID | The AccessKey ID %s is invalid. | AccessKey ID无效。 |
| 403 | RequestTimeTooSkewed | The difference between the request time %s and the current time %s is too large. | 您的请求时间不正确,该请求已被识别为无效。请参考通用参数一节。 |
| 403 | SignatureNotMatch | The request signature we calculated does not match the signature you provided. Check your access key and signing method. | 您发起请求的签名与我们计算不一致,请检查您的签名算法及AccessKey Secret。 |
| 415 | UnsupportedMediaType | The content type must be "application/json". | 请求消息体类型错误。 |
| 429 | ResourceThrottled | The request is throttled. Please try again later. | 因某些原因系统流量已达瓶颈。请稍后重试。 |
| 409 | FlowAlreadyExists | Flow %s already exists. | 已存在同名流程。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。