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 flows of the same name cannot exist in one account.

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.

Definition String Yes version: v1.0 type: flow steps:  - type: pass  name: 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.

Name String Yes flow

The name of the flow. The name must be unique in an Alibaba Cloud account.

Type String Yes FDL

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

RequestId String No testRequestID

The ID of the request. If this parameter is not specified, the system generates a random value.

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

Optional. The ARN of the specified RAM role that Serverless Workflow uses to assume the role when Serverless Workflow executes a flow.

Response parameters

Parameter Type Example Description
CreatedTime String 2019-01-01T01:01:01.001Z

The time when the flow was created.

Definition String version: v1.0 type: flow steps:  - type: pass  name: mypass

The definition of the flow.

Description String test flow

The description of the flow.

Id String e589e092-e2c0-4dee-b306-3574ddfdddf5ccc3

The unique ID of the flow.

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

The time when the flow was last modified.

Name String flow

The name of the flow.

RequestId String testRequestID

The ID of the request. When an HTTP status code returned, Serverless Workflow returns the request ID.

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

The ARN of the specified RAM role.

Type String FDL

The type 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

XML format

<CreateFlowResponseponse>
    <Description>Response in XML format is not supported. </Description>
</CreateFlowResponseponse>

JSON format

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

Error codes

HttpCode Error code Error message Description
403 AccessDenied The resources doesn't belong to you. The error message returned because request authentication failed. For more information, see the actual error message.
400 ActionNotSupported The requested API operation '%s' is incorrect. Please check. The error message returned because the request method is wrong. For more information, see the API documentation and check the spelling.
400 APIVersionNotSupported The requested API version '%s' is not supported yet. Please check. The error message returned because the requested API version is wrong. For more information, see Make API requests.
400 EntityTooLarge The payload size exceeds maximum allowed size (%s bytes). The error message returned because the request message body is too large.
409 FlowAlreadyExists Flow %s already exists. The error message returned because a flow of the same name already exists.
500 InternalServerError An internal error has occurred. Please retry. The error message returned because an internal server error has occurred. Try again later.
403 InvalidAccessKeyID The AccessKey ID %s is invalid. The error message returned because the AccessKey ID is invalid.
400 InvalidArgument Parameter error. The error message returned because the request parameters are invalid. For more information, see the actual error message.
400 MissingRequiredHeader The HTTP header '%s' must be specified. The error message returned because the required request parameters are missing. For more information, see the actual error message.
400 MissingRequiredParams The HTTP query '%s' must be specified. The error message returned because the required request parameters are missing. For more information, see the actual error message.
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.
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.
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 we calculated does not match the request signature you provided. Check your signature algorithm and AccessKey secret.
415 UnsupportedMediaType The content type must be "application/json". The error message returned because the type of the request message body is wrong.

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

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