CreatePipeline

Updated at:

Creates a pipeline.

Operation description

OSS import

  • When source.type is oss, format, region, roleArn, and uri in source.oss are required. You can omit formatOptions or pass an empty object {}. The initial version has no available configuration keys. Non-empty objects and other JSON types return a parameter error. Omit source.inputFields. When LeRobot has no processing nodes, you can pass pipeline.nodes: []. For MCAP, you must pass an empty array.

  • sink.type must be dataset, and sink.dataset must point to an existing dataset.

  • executePolicy.mode must be RunOnce. You can omit runOnce. OSS ignores the time window. If a time field is passed, the value must be an integer.

  • A successful creation indicates that the submission is accepted. Call ListPipelineRuns with the pipeline name to query the import progress. The formal submission independently discovers the OSS input scope.

OSS creation request example

{
  "pipelineName": "robot_import_example",
  "pipeline": {"nodes": []},
  "source": {"type": "oss", "oss": {"format": "lerobot", "region": "cn-beijing", "roleArn": "acs:ram::1234567890123456:role/oss-reader", "uri": "oss://example-bucket/robot-datasets/"}},
  "sink": {"type": "dataset", "dataset": {"agentSpace": "my-agent-space", "dataset": "robot-import-target"}},
  "executePolicy": {"mode": "RunOnce"}
}

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

agentloop:CreatePipeline

create

*Pipeline

acs:agentloop:{#regionId}:{#accountId}:agentspace/{#AgentSpaceName}/pipeline/{#PipelineName}

None None

Request syntax

POST /agentspace/{agentSpace}/pipeline HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

agentSpace

string

No

The name of the AgentSpace where the pipeline is created.

my-agent-space

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body.

pipelineName

string

No

The name of the pipeline. The name must be 3 to 63 characters in length and can contain only lowercase letters, digits, and hyphens.

my-pipeline

description

string

No

The description of the pipeline. The description can be up to 256 characters in length.

Collect trace data from SLS for data cleaning into a dataset

pipeline

object

No

The pipeline configuration, including node orchestration.

{"nodes":[{"id":"select-fields","type":"project","parameters":{"question":"user_query"}}]}

nodes

array<object>

No

The list of nodes. For non-OSS sources, you must pass a non-empty array. For LeRobot sources, you can pass an empty array for direct import. For MCAP sources, you must pass an empty array.

[{"id":"select-fields","type":"project","parameters":{}}]

array<object>

No

The configuration of a single node.

id

string

No

The ID of the node.

node-1

type

string

No

The type of the node.

transform

parameters

object

No

The parameters of the node. The parameters use a key-value structure and vary based on the node type.

{"ID": "ID"}

any

No

The value of the node parameter.

value

source

object

No

The data source of the pipeline.

{"type":"logstore","logstore":{"project":"my-sls-project","logstore":"agent-logs"},"inputFields":[{"name":"question","type":"text"}]}

type

string

No

The type of the data source. Valid values: logstore, dataset, trace, and oss. If you select oss, configure source.oss.

oss

oss PipelineOssSource

No

When source.type is oss, format, region, roleArn, and uri in source.oss are required. You can omit formatOptions or pass an empty object {}. The initial version has no available configuration keys. Non-empty objects and other JSON types return a parameter error.

inputFields

array<object>

No

The input fields and their types. For OSS sources, the server derives the input fields from the metadata. Omit source.inputFields.

[{"name":"question","type":"text"}]

object

No

The input field.

name

string

No

The name of the field.

question

type

string

No

The type of the field. Valid values: text, long, double, and json.

text

logstore

object

No

The datasource config for the SLS Logstore.

{"project":"my-sls-project","logstore":"agent-logs"}

project

string

No

The name of the SLS project.

my-sls-project

logstore

string

No

The name of the SLS Logstore.

my-sls-logstore

query

string

No

The filtered query statement (SLS query and analysis syntax).

* | SELECT *

dataset

object

No

The datasource config for the dataset in the current AgentSpace.

{"dataset":"my-dataset","filter":"status = 'pending'"}

dataset

string

No

The name of the source dataset.

my-dataset

filter

string

No

The data filtering condition for the dataset.

status = 'pending'

version

string

No

The version of the source dataset.

v1

trajectory

object

No

The trajectory data configuration. This parameter is optional and takes effect only when the type is trace. It obtains ATIF standard trajectory data from the trajectory cleansing service and extends it based on features.

{"enrich":{"enabled":true,"columns":["input","output"]}}

enrich

object

No

Trajectory enrichment: mounts trajectory data into the cleansing result based on trace_id. When writing to the dataset, the data is stored in the fixed column agent_trajectory, where the column value is the JSON content of the trajectory.

{"enabled":true,"columns":["input","output"]}

enabled

boolean

No

Specifies whether to enable trajectory enrichment.

false

columns

array

No

The list of enrichment columns. This parameter is retained for compatibility. The current implementation outputs a single fixed column agent_trajectory, and this parameter no longer affects the output.

["input","output","session_id"]

string

No

The name of the trajectory column.

input

sink

object

No

The pipeline sink.

type

string

No

The sink type. Currently, only Dataset is supported.

Dataset

dataset

object

No

The destination dataset configuration.

agentSpace

string

No

The name of the AgentSpace to which the destination dataset belongs.

my-agent-space

dataset

string

No

The name of the destination dataset.

my-dataset

condition

object

No

The conditional routing configuration. This parameter is used only when sink.type is set to condition.

matchMode

string

No

The route matching mode. Currently, only all is supported.

all

routes

array<object>

No

The list of conditional routes.

array<object>

No

The conditional route.

id

string

No

The route ID.

refund

expression

string

No

The route expression in Search Processing Language (SPL). Only where, project, and extend are supported.

* | where intent = 'refund'

sink

object

No

The sink for the route.

type

string

No

The route sink type. Currently, only dataset is supported.

dataset

dataset

object

No

The destination dataset for the route.

agentSpace

string

No

The name of the AgentSpace to which the destination dataset belongs.

my-agent-space

dataset

string

No

The name of the destination dataset.

refund-result

defaultSink

object

No

The default sink used when no conditional route is matched.

type

string

No

The default sink type. Currently, only dataset is supported.

dataset

dataset

object

No

The default destination dataset.

agentSpace

string

No

The name of the AgentSpace to which the default destination dataset belongs.

my-agent-space

dataset

string

No

The name of the default destination dataset.

other-result

executePolicy

object

No

The execution policy.

{"mode":"RunOnce","runOnce":{"fromTime":1735660800,"toTime":1735664400}}

mode

string

No

The execution mode. Valid values: RunOnce (single execution) and Scheduled (periodic scheduling).

RunOnce

runOnce

object

No

The RunOnce configuration. This parameter is required only when mode is set to RunOnce.

{"fromTime":1735660800,"toTime":1735664400}

fromTime

integer

No

The start time of the data processing window in UNIX seconds. This value must be less than toTime.

1735660800

toTime

integer

No

The end time of the data processing window in UNIX seconds. This value must be greater than fromTime.

1735747200

continuous

object

No

The continuous execution configuration. This parameter is used when type is set to trace. The processing frequency is a fixed value managed by the server.

{"fromTime":1735660800}

fromTime

integer

No

The bootstrap historical start time in UNIX seconds. The precision is the same as runOnce or scheduled.fromTime. Millisecond values greater than or equal to 1e12 are automatically converted. The cursor starts from this time aligned to the grid and catches up window by window. After catching up, it switches to minute intervals. By default, it starts from the current time and processes only incremental data.

1735660800

scheduled

object

No

The scheduled execution configuration. This parameter is required only when mode is set to Scheduled.

{"interval":"1h","fromTime":1735660800}

interval

string

No

The scheduling interval. Valid values: 1h, 6h, 12h, and 1d.

1h

fromTime

integer

No

The scheduling start time in UNIX milliseconds.

1735660800000

pipelineKind

string

No

The pipeline type. Valid values: PROCESSING (data processing) and ORCHESTRATION (orchestration task).

ORCHESTRATION

clientToken

string

No

The idempotency token. A unique string generated by the client to ensure the idempotence of the creation operation.

a1b2c3d4-1234-5678-90ab-cdef12345678

Response elements

Element

Type

Description

Example

object

The response data.

requestId

string

The request ID, which is used to locate the request during troubleshooting.

9ACFB10A-1B2C-3D4E-5F6G-7H8I9J0K1L2M

Examples

Success response

JSON format

{
  "requestId": "9ACFB10A-1B2C-3D4E-5F6G-7H8I9J0K1L2M"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.