全部产品
Search
文档中心

人工智能平台 PAI:CreatePipelineRun - 创建工作流任务

更新时间:Aug 28, 2026

创建工作流任务。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

paiflow:CreatePipelineRun

create

*全部资源

*

无 无

请求语法

POST /api/v1/pipelineruns HTTP/1.1

请求参数

名称

类型

必填

描述

示例值

body

object

否

工作流任务。

PipelineId

string

否

工作流的 ID。 PipelineId 和 PipelineManifest 二选一。

flow-rer7y***

Name

string

否

工作流任务名字。若为空,则自动生成名字。

testName

PipelineManifest

string

否

工作流定义,具体样例见下方请求参数补充说明。 PipelineId 和 PipelineManifest 二选一。

apiVersion: "core/v1"\nmetadata:\n provider: "1557702098******"\n version: "v1"\n identifier: "my_pipeline"\n name: "source-transform"\nspec:\n inputs:\n parameters:\n - name: "execution_maxcompute"\n type: "Map"\n pipelines:\n - apiVersion: "core/v1"\n metadata:\n provider: "pai"\n version: "v1"\n identifier: "data_source"\n name: "data_source"\n displayName: "读数据表-1"\n spec:\n arguments:\n parameters:\n - name: "inputTableName"\n value: "pai_online_project.wumai_data"\n - name: "partition"\n value: "20220101"\n - name: "execution"\n from: "{{inputs.parameters.execution_maxcompute}}"\n - apiVersion: "core/v1"\n metadata:\n provider: "pai"\n version: "v1"\n identifier: "type_transform"\n name: "type_transform"\n displayName: "类型转换-1"\n spec:\n arguments:\n artifacts:\n - name: "inputTable"\n from: "{{pipelines.data_source.outputs.artifacts.outputTable}}"\n parameters:\n - name: "cols_to_double"\n value: "time,hour,pm2,pm10,so2,co,no2"\n - name: "execution"\n from: "{{inputs.parameters.execution_maxcompute}}"\n dependencies:\n - "data_source"

Arguments

string

否

参数。

arguments: parameters: - name: "execution_maxcompute" value: endpoint: "http://service***" odpsProject: "pai***"

NoConfirmRequired

boolean

否

是否直接启动 pipelineRun,取值如下:

  • true 代表直接启动(默认)。

  • false 代表只创建 run,但先不启动。

true

WorkspaceId

string

是

工作空间 ID。

84***

SourceType

string

否

工作流任务来源类型,支持如下值:

  • UNKNOWN(默认)

  • SDK

  • DESIGNER

  • M6

UNKNOWN

SourceId

string

否

来源 ID。

experiment-ybpy***

Options

string

否

创建工作流任务选项,格式为 JSON。

{"mlflow":{"experimentId":"exp-1jdk***"}}

Accessibility

string

否

工作流的可见性:

  • PUBLIC(默认):工作空间内公开可见。

  • PRIVATE:仅自己可见。

PUBLIC

工作流定义样例:该工作流由读数据表(data_source),类型转换(type_transform)组成。

apiVersion: "core/v1"
metadata:
  provider: "1557702098******"
  version: "v1"
  identifier: "my_pipeline"
  name: "source-transform"
spec:
  inputs:
    parameters:
    - name: "execution_maxcompute"
      type: "Map"
  pipelines:
  - apiVersion: "core/v1"
    metadata:
      provider: "pai"
      version: "v1"
      identifier: "data_source"
      name: "data_source"
      displayName: "读数据表-1"
    spec:
      arguments:
        parameters:
        - name: "inputTableName"
          value: "pai_online_project.wumai_data"
        - name: "partition"
          value: "20220101"
        - name: "execution"
          from: "{{inputs.parameters.execution_maxcompute}}"
  - apiVersion: "core/v1"
    metadata:
      provider: "pai"
      version: "v1"
      identifier: "type_transform"
      name: "type_transform"
      displayName: "类型转换-1"
    spec:
      arguments:
        artifacts:
        - name: "inputTable"
          from: "{{pipelines.data_source.outputs.artifacts.outputTable}}"
        parameters:
        - name: "cols_to_double"
          value: "time,hour,pm2,pm10,so2,co,no2"
        - name: "execution"
          from: "{{inputs.parameters.execution_maxcompute}}"
      dependencies:
      - "data_source"

返回参数

名称

类型

描述

示例值

object

返回结构体。

RequestId

string

请求 ID。

DA869D1B-035A-43B2-ACC1-C56681BD9FAA

PipelineRunId

string

工作流任务 ID。

flow-rbvg***

示例

正常返回示例

JSON格式

{
  "RequestId": "DA869D1B-035A-43B2-ACC1-C56681BD9FAA",
  "PipelineRunId": "flow-rbvg***"
}

错误码

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。