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

    accountId stringrequired

    Account id

    definitionId stringrequired

    Workflow definition id.

Query Parameters

    limit integer

    Possible values: >= 1 and <= 500

    Number of items to include in the response.

    Default value: 100
    offset integer

    Possible values: >= 0

    Page offset. Setting limit to 10 and offset to 0 returns the first 10 items. Increment offset to retrieve more items.

    Default value: 0
    version integer

    Possible values: >= 1

    Version of the workflow definition.

    status string

    Possible values: [Runnable, Suspended, Complete, Terminated]

    startTimeFrom string

    Minimum workflow instance start time in ISO 8601 format

    startTimeTo string

    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 [
  • workflowIdstringrequired

    Unique id of the workflow instance.

    data objectrequired

    Workflow context.

    accountIdstringrequired

    Id of the account to which the workflow definition belongs.

    triggeredAtstringrequired

    ISO 8601 formatted timestamp when the trigger that started the workflow was raised.

    subAccountIdstring

    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.

    definitionIdstringrequired

    Id of the workflow definition to which the workflow instance belongs to.

    versionintegerrequired

    Version of the workflow definition to which the workflow instance belongs to.

    Possible values: >= 1

    statusstringrequired

    Last known status of the workflow instance. Supported statuses are

    • 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.
    startedAtstringrequired

    ISO 8601 formatted timestamp of the workflow start time.

    completedAtstringrequired

    If the workflow has been completed, ISO 8601 formatted timestamp of the completion time. Otherwise, null.

    Default value: 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

    codeintegerrequired

    Error code.

    messagestringrequired

    Description of the error.

    errorIdstringrequired

    Unique error id.

    timestampstringrequired

    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

    codeintegerrequired

    Error code.

    messagestringrequired

    Description of the error.

    errorIdstringrequired

    Unique error id.

    timestampstringrequired

    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.

Was this article helpful?
or
0 out of 0 found this helpful

0 Comments

Please sign in to leave a comment.

Didn't find what you were looking for?

Submit a request