PreviewPipeline
Previews a pipeline. Runs a trial query based on the specified data source, node orchestration, and time range without creating pipeline resources, and returns a small amount of sample data to authenticate parameter settings and preview processing results.
Operation description
Request description
agentSpace must be an AgentSpace created under the current account.
source.type supports logstore, dataset, trace, and oss. If you select logstore, the project and Logstore used must be authorized in the AgentSpace and reside in the same region.
If you select oss, configure source.oss and omit source.inputFields. The server derives the schema from the source. For LeRobot, you can pass an empty array for pipeline.nodes to preview directly. For MCAP, you must pass an empty array. OSS previews ignore fromTime and toTime.
For other sources, you must pass a non-empty pipeline.nodes array and provide fromTime and toTime in UNIX seconds. The fromTime must be earlier than the toTime.
A preview returns up to 5 samples and filters out internal fields of the data source. For OSS, a batch tries up to 5 candidates. Failed candidates or candidates filtered out by the processing chain also count toward the limit. If no samples are returned but the schema can be derived, meta.schema is still returned.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
agentloop:PreviewPipeline |
list |
*Pipeline
|
None | None |
Request syntax
POST /agentspace/{agentSpace}/pipeline/preview HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| agentSpace |
string |
No |
The name of the AgentSpace where the pipeline is located. |
my-agent-space |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. |
|
| 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. trace indicates the trajectory signal-driven processing mode. If you select oss, specify source.oss. |
oss |
| oss | PipelineOssSource |
No |
The OSS data source configuration. When source.type is set to 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 field 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 SLS Logstore datasource config. |
{"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 Dataset datasource config 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 filter 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 type is set to trace. It obtains ATIF standard trajectory data from the trajectory cleaning service and extends it by feature. |
{"enrich":{"enabled":true,"columns":["input","output"]}} |
| enrich |
object |
No |
The trajectory enrichment configuration. It mounts trajectory data into the cleaning result by trace_id. When writing to a dataset, it uses the fixed column agent_trajectory to store the trajectory JSON content. |
{"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 |
|
| pipeline |
object |
No |
The pipeline configuration, which defines the 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 to preview directly. 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. This is a key-value structure that varies based on the node type. |
{"ID":"ID"} |
|
any |
No |
The value of the node parameter. |
{"ID":"ID"} |
|
| fromTime |
integer |
No |
The start time of the preview data window, in UNIX seconds. For OSS sources, the preview is based on objects or episodes, and the time window is ignored. |
1735660800 |
| toTime |
integer |
No |
The end time of the preview data window, in UNIX seconds. For OSS sources, the preview is based on objects or episodes, and the time window is ignored. |
1735747200 |
For OSS sources,
source.oss.formatsupportslerobotandmcap. LeRobot accepts v2.1 package directories or parent directories. MCAP accepts exact.mcapobject keys or directories ending with/.When
source.typeis set tooss, theformat,region,roleArn, anduriparameters insource.ossare all required.formatOptionscan be omitted or passed as an empty object{}. The initial version has no available configuration keys. Non-empty objects and other JSON types return a parameter error.source.oss.roleArnmust belong to the currently authenticated account.The preview provides the final output schema and samples. The formal submission independently discovers the OSS scope.
source.logstore.queryuses SLS query syntax and can include SPL stages. Verify the query in the SLS console. Fill in theparametersof a node based on thetypeof the node.
Sample OSS preview request
{
"source": {
"type": "oss",
"oss": {
"format": "lerobot",
"region": "cn-beijing",
"roleArn": "acs:ram::1234567890123456:role/oss-reader",
"uri": "oss://example-bucket/robot-datasets/"
}
},
"pipeline": {"nodes": []}
}
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response data. |
||
| requestId |
string |
The request ID used to locate the request during troubleshooting. |
9ACFB10A-1B2C-3D4E-5F6G-7H8I9J0K1L2M |
| meta |
object |
The query metadata. |
|
| progress |
string |
The SLS query progress. A value of Complete indicates that the query is completed. |
Complete |
| aggQuery |
string |
The SPL statement for aggregation analysis. |
* | SELECT status, count(*) AS cnt GROUP BY status |
| whereQuery |
string |
The SPL statement for filter conditions. |
status: 200 |
| hasSQL |
boolean |
Specifies whether an SQL query is used. |
true |
| processedRows |
integer |
The number of processed log rows. |
10000 |
| elapsedMillisecond |
integer |
The query duration in milliseconds. |
1200 |
| cpuSec |
number |
The consumed CPU time in seconds. |
0.5 |
| cpuCores |
integer |
The number of consumed CPU cores. |
2 |
| keys |
array |
The list of result column names. |
["status","method","path"] |
|
string |
The list of result column names. |
[] |
|
| schema |
object |
The final output dataset schema of the pipeline. The keys are field names, and the type in the values supports text, long, double, and json. The field order is subject to keys. |
{"status":{"type":"long"}} |
|
object |
The schema description object. |
||
| type |
string |
The dataset field type. Valid values: text, long, double, and json. |
text |
| terms |
array<object> |
The column types and aggregation information. |
[{"column":"status","type":"long"}] |
|
object |
The column types and aggregation information. |
{"column":"status","type":"long"} |
|
| limited |
integer |
The maximum number of rows returned in the result. |
5 |
| mode |
integer |
The query mode identifier. |
1 |
| scanBytes |
integer |
The number of bytes of scanned raw data. |
1048576 |
| count |
integer |
The number of matched log entries. For OSS sources, the actual number of sample rows is returned. |
100 |
| processedBytes |
integer |
The number of bytes of processed data. |
524288 |
| isAccurate |
boolean |
Specifies whether nanosecond-level ordering is enabled. |
true |
| columnTypes |
array |
The |
["long","string"] |
|
string |
The |
string |
|
| failedRows |
integer |
The number of rows that failed to be processed in the preview sample. This field is omitted if it is not counted or the count is 0. |
1 |
| skippedRows |
integer |
The number of rows skipped in the preview sample, such as rows filtered by the processing chain. This field is omitted if it is not counted or the count is 0. |
2 |
| data |
array<object> |
The |
[{"status":"200","method":"POST"}] |
|
object |
The field values. |
||
|
string |
The returned data. |
saturation |
The
datafield is a collection of sample rows (maps in an array) and contains only the first N rows (up to 5 rows by default). It does not reflect the complete write plan.The
meta.limitedfield indicates whether the row limit is reached. If the value is true, the current data is a truncated subset.The
meta.modefield describes the execution mode (spl, sql, or hybrid) and can be used to understand query degradation behavior.The
meta.columnTypesfield provides a mapping from column names to data types (string, long, double, or json).The
meta.processedRows,processedBytes,scanBytes,cpuSec, andcpuCoresfields reflect resource consumption and can be used for capacity estimation before creating a pipeline.If the preview does not match any data,
datais an empty array,meta.countis 0, andrequestIdis still returned for log tracing.
The OSS preview uses meta.schema to return the final output schema. Check meta.keys for the column order. If the sample is empty, meta.schema is still returned as long as the schema can be inferred.
Examples
Success response
JSON format
{
"requestId": "9ACFB10A-1B2C-3D4E-5F6G-7H8I9J0K1L2M",
"meta": {
"progress": "Complete",
"aggQuery": "* | SELECT status, count(*) AS cnt GROUP BY status",
"whereQuery": "status: 200",
"hasSQL": true,
"processedRows": 10000,
"elapsedMillisecond": 1200,
"cpuSec": 0.5,
"cpuCores": 2,
"keys": [
"[]"
],
"schema": {
"key": {
"type": "text"
}
},
"terms": [
{
"column": "status",
"type": "long"
}
],
"limited": 5,
"mode": 1,
"scanBytes": 1048576,
"count": 100,
"processedBytes": 524288,
"isAccurate": true,
"columnTypes": [
"string"
],
"failedRows": 1,
"skippedRows": 2
},
"data": [
{
"key": "saturation"
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.