Resuming a Failed Workflow Instance
API Description
You can use this API to resume a failed workflow instance. Only a failed workflow instance can be resumed. Once resumed, the execution continues from where the workflow instance failed. Executed parts are not executed again.
Method Definition
WorkflowClient.restoreFailedWorkflowExecution(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 |
|---|---|
| SDK common result object |
| GetResult.body Type | Description |
|---|---|
| Response Result of the Request for Restoring a Failed Workflow Instance | 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'
)
# Restore a failed workflow instance.
try:
resp = restoreFailedWorkflowExecution('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() Last Article: Querying a Workflow Instance
Next Article: Managing Trigger Policies
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.