Retrieve a list of workflow instances
GET https://automation.8x8.com/api/v1/accounts/:accountId/definitions/:definitionId/workflows
Use this resource to explore workflows created based on a specific workflow definition. If the definition version is not specified, workflows for the latest version are returned. Results are ordered in descending order of their creation time. Use parameters limit and offset to paginate through the list.
Request
Path Parameters
Account id
Workflow definition id.
Query Parameters
Possible values: >= 1 and <= 500
Number of items to include in the response.
100
Possible values: >= 0
Page offset. Setting limit to 10 and offset to 0 returns the first 10 items. Increment offset to retrieve more items.
0
Possible values: >= 1
Version of the workflow definition.
Possible values: [Runnable, Suspended, Complete, Terminated]
Minimum workflow instance start time in ISO 8601 format
Maximum workflow instance start time in ISO 8601 format
List of workflow instances. If there are no workflows by the specified definition id, an empty list is returned.
Schema
- Array [
- 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.
- ]
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
[
{
"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":"60dbe307fe55d99fc083db62",
"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"
}
]
Definition 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 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-workflow-instances · 8x8 CPaaS Developer Docs. Synced for support deflection.
0 Comments