Creates a flow.

Description

  • The number of flows that each user can create is restricted by resources (for more information, see Limits). If you need to create more flows, submit a ticket.
  • At the user level, flows are distinguished by names. The name of a flow in one account must be unique.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateFlow

The operation that you want to perform. Set the value to CreateFlow.

RequestId String No testRequestID

The ID of the request. If you specify this parameter, the system uses this value as the ID of the request. If you do not specify this parameter, the system generates a value at random.

Name String Yes flow

The name of the flow. The name is unique within the region and cannot be modified after the flow is created. Configure this parameter based on the following rules:

  • The name can contain letters, digits, underscores (_), and hyphens (-).
  • The name must start with a letter or an underscore (_).
  • The name is case-sensitive.
  • The name must be 1 to 128 characters in length.
Definition String Yes version:&nbsp;v1.0<br/>type:&nbsp;flow<br/>steps:<br/>&nbsp;-&nbsp;type:&nbsp;pass<br/>&nbsp;name:&nbsp;mypass

The definition of the flow. It must comply with the Flow Definition Language (FDL) syntax.

Description String Yes test flow

The description of the flow.

Type String Yes FDL

The type of the flow. Set the value to FDL.

RoleArn String No acs:ram:${region}:${accountID}:${role}

The Alibaba Cloud resource name (ARN) of the specified RAM role that Serverless Workflow assumes to invoke resources when the task is executed.

ExternalStorageLocation String No /path

The path of the external storage.

Response parameters

Parameter Type Example Description
Type String FDL

The type of the flow.

Definition String version: v1.0\ntype: flow\nname: test\nsteps:\n - type: pass\n name: mypass

The definition of the flow.

RoleArn String acs:ram:${region}:${accountID}:${role}

The ARN of the specified RAM role.

RequestId String testRequestID

The ID of the request. Each time an http status code is returned, Serverless Workflow returns a value for the parameter.

Description String test flow

The description of the flow.

Name String flow

The name of the flow.

CreatedTime String 2019-01-01T01:01:01.001Z

The time when the flow was created.

LastModifiedTime String 2019-01-01T01:01:01.001Z

The time when the flow was last modified.

Id String e589e092-e2c0-4dee-b306-3574ddfdddf5****

The unique ID of the flow.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateFlow
&Definition=version: v1.0 type: flow steps: - type: pass name: mypass
&Description=test flow
&Name=flow
&RoleArn=acs:ram::${accountID}:${role}
&Type=FDL
&<Common request parameters>

Sample success responses

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Type" : "FDL",
  "Definition" : "version: v1.0\\ntype: flow\\nname: test\\nsteps:\\n - type: pass\\n name: mypass",
  "RoleArn" : "acs:ram:${region}:${accountID}:${role}",
  "RequestId" : "testRequestID",
  "Description" : "test flow",
  "Name" : "flow",
  "CreatedTime" : "2019-01-01T01:01:01.001Z",
  "LastModifiedTime" : "2019-01-01T01:01:01.001Z",
  "Id" : "e589e092-e2c0-4dee-b306-3574ddfdddf5****"
}

Error codes

HttpCode Error code Error message Description
400 EntityTooLarge The payload size exceeds maximum allowed size (%s bytes). The error message returned because the request message body is too large.
400 InvalidArgument Parameter error. The error message returned because the values specified for one or more request parameters are invalid. For more information, see the error message.
400 MissingRequiredHeader The HTTP header '%s' must be specified. The error message returned because a required request parameter is not specified. For more information, see the error message.
400 MissingRequiredParams The HTTP query '%s' must be specified. The error message returned because a required request parameter is not specified. For more information, see the error message.
403 InvalidAccessKeyID The AccessKey ID %s is invalid. The error message returned because the specified AccessKey ID is invalid.
403 RequestTimeTooSkewed The difference between the request time %s and the current time %s is too large. The error message returned because your request time is wrong. The request has been identified as invalid. For more information, see the "Common parameters" section.
403 SignatureNotMatch The request signature we calculated does not match the signature you provided. Check your access key and signing method. The error message returned because the request signature that the system calculates does not match the request signature that you provided. Check your signature algorithm and AccessKey secret.
409 FlowAlreadyExists Flow %s already exists. The error message returned because a flow of the same name already exists.
415 UnsupportedMediaType The content type must be "application/json". The error message returned because the type of the request message body is wrong.
429 ResourceThrottled The request is throttled. Please try again later. The error message returned because the request is throttled for some reason. Try again later.
500 InternalServerError An internal error has occurred. Please retry. The error message returned because an internal server error has occurred. Try again later.

For a list of error codes, visit the API Error Center.