Retrieve workflow instance status
GET https://automation.8x8.com/api/v1/accounts/:accountId/definitions/:definitionId/workflows/:workflowId
Use this resource to view the status of a workflow instance.
Request
Path Parameters
Account id
Workflow definition id.
Workflow instance id.
Query Parameters
If set to true, response includes detailed execution logs of workflow steps. This information is useful when debugging a workflow definition.
false
Workflow instance.
Schema
-
oneOf
- Runnable (Workflow is either currently running, waiting for an event, or pausing for a duration).
- Suspended (Workflow is suspended (usually by issuing the suspend command). A suspended workflow can be resumed by issuing the resume command).
- Complete (Workflow has run to completion without errors).
- Terminated (Workflow has either been terminated manually or faulted). If the workflow has faulted, you can use the workflow error resource to figure out what caused the error.
- Runnable (Workflow is either currently running, waiting for an event, or pausing for a duration).
- Suspended (Workflow is suspended (usually by issuing the suspend command). A suspended workflow can be resumed by issuing the resume command).
- Complete (Workflow has run to completion without errors).
- Terminated (Workflow has either been terminated manually or faulted). If the workflow has faulted, you can use the workflow error resource to figure out what caused the error.
- Array [
- Pending (step is waiting to be executed)
- Running (step is currently in progress)
- Complete (step has completed without errors)
- Sleeping (step is waiting for a duration like in the case of a Wait step)
- WaitingForEvent (step is waiting for an event like a reply to a message)
- Failed (step execution has faulted)
- Cancelled (step has been cancelled like in the case of an event timeout)
- ]
Unique id of the workflow instance.
data objectrequired
Workflow context.
Id of the account to which the workflow definition belongs.
ISO 8601 formatted timestamp when the trigger that started the workflow was raised.
Subaccount id under which the workflow is running. Subaccount id is only available if the trigger was raised with the subaccount id. For inbound SMS and chat apps triggers subaccount id is usually available.
Id of the workflow definition to which the workflow instance belongs to.
Version of the workflow definition to which the workflow instance belongs to.
Possible values: >= 1
Last known status of the workflow instance. Supported statuses are
ISO 8601 formatted timestamp of the workflow start time.
If the workflow has been completed, ISO 8601 formatted timestamp of the completion time. Otherwise, null.
null
Unique id of the workflow instance.
data objectrequired
Workflow context.
Id of the account to which the workflow definition belongs.
ISO 8601 formatted timestamp when the trigger that started the workflow was raised.
Subaccount id under which the workflow is running. Subaccount id is only available if the trigger was raised with the subaccount id. For inbound SMS and chat apps triggers subaccount id is usually available.
Id of the workflow definition to which the workflow instance belongs to.
Version of the workflow definition to which the workflow instance belongs to.
Possible values: >= 1
Last known status of the workflow instance. Supported statuses are
ISO 8601 formatted timestamp of the workflow start time.
If the workflow has been completed, ISO 8601 formatted timestamp of the completion time. Otherwise, null.
null
logs object[]
Execution log of the workflow steps which is useful for debugging the workflow.
Unique step execution id.
Id of the step provided by the user when creating the workflow definition.
ISO 8601 formatted timestamp of the step start time.
ISO 8601 formatted timestamp of the step completion time.
Last known status of the step. Available statuses are
{
"workflowId":"string",
"data":{
"accountId":"string",
"triggeredAt":"string",
"subAccountId":"string"
},
"definitionId":"string",
"version":0,
"status":"string",
"startedAt":"string",
"completedAt":null
}
{
"workflowId":"60dbe307fe55d99fc083db61",
"data":{
"payload":{
"umid":"9e09ac86-bd74-5465-851d-1eb5a5fdbb9a",
"user":{
"channelUserId":"test_user_id",
"name":"test_user_name"
},
"content":{
"text":"Hello, world!"
}
},
"accountId":"test_account_id",
"subAccountId":"test_subaccount_id",
"triggeredAt":"2021-06-30T03:20:39.3857479Z"
},
"definitionId":"5870442f-3ddd-4657-b74c-6e17308f5230",
"version":1,
"status":"Complete",
"startedAt":"2021-06-30T03:20:39.49Z",
"completedAt":"2021-06-30T03:21:25.83Z"
}
{
"workflowId":"60dbe307fe55d99fc083db61",
"data":{
"payload":{
"umid":"9e09ac86-bd74-5465-851d-1eb5a5fdbb9a",
"user":{
"channelUserId":"test_user_id",
"name":"test_user_name"
},
"content":{
"text":"Hello, world!"
}
},
"accountId":"test_account_id",
"subAccountId":"test_subaccount_id",
"triggeredAt":"2021-06-30T03:20:39.3857479Z"
},
"definitionId":"5870442f-3ddd-4657-b74c-6e17308f5230",
"version":1,
"status":"Complete",
"startedAt":"2021-06-30T03:20:39.49Z",
"completedAt":"2021-06-30T03:21:25.83Z",
"logs":[
{
"id":"b2c6185b-5bbd-424e-bea0-3d09d5d14566",
"stepName":"step1",
"startedAt":"2021-06-30T03:20:39.68Z",
"completedAt":"2021-06-30T03:20:39.69Z",
"status":"Complete"
},
{
"id":"b2c6185b-5bbd-424e-bea0-3d09d5d14567",
"stepName":"step2",
"startedAt":"2021-06-30T03:20:56.68Z",
"completedAt":"2021-06-30T03:20:58.69Z",
"status":"Complete"
}
]
}
Workflow definition id or the workflow instance id is invalid (not a valid uuid).
Schema
Error code.
Description of the error.
Unique error id.
Timestamp when the error occurred.
{
"code":0,
"message":"string",
"errorId":"string",
"timestamp":"string"
}
{
"code":1000,
"message":"Invalid definition id.",
"errorId":"2558ff83-c8db-4890-805e-ad64001857a1",
"timestamp":"2021-07-13T01:28:37.66Z"
}
Workflow instance or definition is not found.
Schema
Error code.
Description of the error.
Unique error id.
Timestamp when the error occurred.
{
"code":0,
"message":"string",
"errorId":"string",
"timestamp":"string"
}
{
"code":1300,
"message":"Definition 2aa9465e-dec7-4c3e-8fa6-bd168af9eaca not found.",
"errorId":"2558ff83-c8db-4890-805e-ad64001857a1",
"timestamp":"2021-07-13T01:28:37.66Z"
}
Source: https://developer.8x8.com/connect/reference/get-instance-status · 8x8 CPaaS Developer Docs. Synced for support deflection.
0 Comments