Trigger file workflow

Triggers the workflow associated with the specified file and returns the actual number triggered.

HTTP
POST $CLOUDSIGMA_API_BASE/catalog/file/trigger_workflow

Before you call this API

Configure the regional API endpoint and authentication, and select the target workspace.

First query the file list to obtain the target file and the volume to which it belongs.

Set the operation-specific values used in the request:

  • $VOLUME_ID: ID of the root volume to which the file belongs.

  • $FILE_ID: The file ID to trigger the associated workflow.

Request

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/catalog/file/trigger_workflow" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "volume_id": '"$VOLUME_ID"',
    "file_ids": ["'"$FILE_ID"'"]
  }'

Request body

Parameter

Type

Required

Description

volume_id

integer

Yes

ID of the root volume to which the file belongs.

file_ids

string[]

Yes

List of file IDs to trigger.

[] after a type means an array. For example, string[] is an array of strings.

Successful response

When successful, 200 is returned. triggered indicates the number of associated workflows actually triggered this time.

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "triggered": 1
  }
}

The response fields are as follows.

Field

Type

Description

data.triggered

integer

The number of associated workflows actually triggered this time.

Error response

JSON
{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效",
  "data": null
}

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

ErrParamInvalid

Invalid volume ID or file ID list.

Check the resource identifier in the request body.

403

ErrForbidden

The current identity does not have read permission to the target volume.

Use credentials with read permissions.

500

ErrServer

The server failed to trigger the associated workflow.

Try again later and confirm the execution status via the relevant workflow page.

Last updated on