全部產品
Search
文件中心

CloudFlow:CreateFlow

更新時間:Oct 23, 2026

建立一個流程。

介面說明

介面說明

  • 每個使用者所能建立的流程個數受資源限制(詳見使用限制),如果您有特殊需求,可以提工單進行調整。

  • 流程在使用者級別是按照名稱來區分的,即單一帳號下不可以存在同名流程。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

fnf:CreateFlow

create

*Flow

acs:fnf:{#regionId}:{#accountId}:flow/*

無 無

請求參數

名稱

類型

必填

描述

樣本值

Name

string

是

流程名稱。該名稱在同一地域內唯一,建立後不可修改。取值說明如下:

  • 支援英文字元(a~z)或(A~Z)、數字(0~9)、底線(_)和短橫線(-)。

  • 首字母必須為英文字母(a~z)、(A~Z)或底線(_)。

  • 區分大小寫。

  • 長度為 1~128 個字元。

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 :

    流程描述語言。

FDL

RoleArn

string

否

流程執行依賴的授權角色資源描述符資訊。用於在執行流程時,Serverless 工作流服務扮演該角色(AssumeRole)操作相關的流程資源。

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

ExternalStorageLocation

string

否

外部儲存位置。

/path

ExecutionMode

string

否

執行模式,列舉類型,可以是 Express 和 Standard;考慮到向前相容,空字串等價於 Standard 執行模式。

枚舉值:

  • Express :

    快速執行模式。

  • Standard :

    標準執行模式。

Standard

Environment

object

否

設定 Flow 執行期間可以存取的環境資訊。

Variables

array<object>

否

設定 Flow 執行期間可以存取的環境變數清單。

object

否

設定 Flow 執行期間可以存取的變數清單。

Name

string

否

變數名稱。

key

Value

string

否

變數值。

value

Description

string

否

變數描述。

description

ResourceGroupId

string

否

資源群組 ID。

返回參數

名稱

類型

描述

樣本值

object

傳回資料。

Type

string

流程類型。

枚舉值:

  • FDL :

    流程描述語言。

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。當有 http status code 傳回時,Serverless 工作流都會傳回請求 ID。

testRequestID

Description

string

流程描述資訊。

my test flow

Name

string

流程名稱。

my_flow_name

CreatedTime

string

流程建立時間,採用 ISO 8601 標準的 UTC 時間,格式為 YYYY-MM-DDThh:mm:ss.sssZ。

2019-01-01T01:01:01.001Z

LastModifiedTime

string

流程最近一次的變更時間,採用 ISO 8601 標準的 UTC 時間,格式為 YYYY-MM-DDThh:mm:ss.sssZ。

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

ResourceGroupId

string

流程所屬的資源群組 ID。

rg-xxx

樣本

正常返回樣本

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"
      }
    ]
  },
  "ResourceGroupId": "rg-xxx"
}

錯誤碼

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.
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.
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.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情。