Help Center> Object Storage Service> API Reference> APIs> Data+> Asynchronously Starting a Workflow by an API

Asynchronously Starting a Workflow by an API

Functions

Asynchronously starts an existing workflow and generates a workflow instance by calling an API.

Request Syntax

POST /v2/workflows/{graph_name} HTTP/1.1
Host: obs.cn-north-4.myhuaweicloud.com 
Authorization: authorization
Content-Type: application/json
Content-Length: length
Date: date

json body

Request parameters

Table 1 Request parameters

Parameter

Mandatory

Type

Description

Constraints

graph_name

Yes

String

Workflow name

The name should start with a letter or digit, and contain a maximum of 64 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed.

Request Headers

This request uses common headers. For details, see Table 3.

Request Elements

Table 2 Parameters

Parameter

Mandatory

Type

Description

Constraints

bucket

Yes

String

Bucket name

-

object

Yes

String

Object name

-

inputs

No

Json

Parameters that can be modified in a workflow

The key in the map must be the name of a parameter in the workflow.

Response Syntax

HTTP/1.1 status_code 
Date: date 
Content-Length: length 
X-Request-ID: obs request id

json body

Response Headers

The response to the request uses common headers. For details, see Table 1.

Response Elements

Table 3 Response elements

Parameter

Type

Description

execution_urn

String

URN of a running instance

started_at

String

Start time of a running instance

execution_name

String

Name of a running instance

Error Responses

No special error responses are returned. For details about error responses, see Table 2.

Sample Request

POST /v2/workflows/{graph_name} HTTP/1.1
Host: obs.cn-north-4.myhuaweicloud.com 
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:sc2PM13Wlfcoc/YZLK0MwsI2Zpo=
Content-Type: application/json
Content-Length: 100
Date: Thu, 27 Aug 2020 12:38:10 GMT

{
    "bucket": "demo-bucket",
    "object": "/mpc/demo.mp4",
    "inputs": {
        "<parameter-name>": <parameter-value>
    }
}

Sample Response

HTTP/1.1 200 OK 
Date: Thu, 27 Aug 2020 12:38:10 GMT 
Content-Length: 100 
X-Request-ID: 000001742FE8FB3CCA20173B00807C43

{
    "execution_urn": "urn:fgs:<region_id>:<project_id>:execution:<graph_name>:<execution_name>:<domain_id>",
    "execution_name": "<execution_name>",
    "started_at": "2020-04-23T13:37:43.847Z"
}