Querying a Workflow Instance

API Description

You can use this API to query the details of a workflow instance.

Method Definition

WorkflowClient.getWorkflowExecution(executionName, graphName)

Request Parameters

Parameter

Mandatory or Optional

Type

Description

Constraint

executionName

Mandatory

str

Workflow instance name

The workflow instance must be an existing one.

graphName

Mandatory

str

Workflow name

The workflow must be an existing one.

Returned Results

Type

Description

GetResult

SDK common result object

GetResult.body Type

Description

Response Result of the Request for Querying the Workflow Instance List

Response result

Sample Code

# Import the module.
from obs import WorkflowClient

# Create a WorkflowClient instance.
workflowClient = WorkflowClient(
    access_key_id='*** Provide your Access Key ***',
    secret_access_key='*** Provide your Secret Key ***',
    server='https://your-endpoint'
)

# Query a workflow instance.
try:
    resp = workflowClient.getWorkflowExecution('executionName', 'graphName')
      
    if resp.status < 300: 
        print('requestId:', resp.requestId) 
    else: 
        print('errorCode:', resp.errorCode) 
        print('errorMessage:', resp.errorMessage)
except:
    import traceback
    print(traceback.format_exc())


# Close workflowClient.
workflowClient.close()