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

    accountId stringrequired

    Account id

    definitionId stringrequired

    Workflow definition id.

    workflowId stringrequired

    Workflow instance id.

Query Parameters

    includeLogs boolean

    If set to true, response includes detailed execution logs of workflow steps. This information is useful when debugging a workflow definition.

    Default value: false

Workflow instance.

Schema

    oneOf
    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
    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

    logs object[]

    Execution log of the workflow steps which is useful for debugging the workflow.

  • Array [
  • idstringrequired

    Unique step execution id.

    stepNamestringrequired

    Id of the step provided by the user when creating the workflow definition.

    startedAtstringrequired

    ISO 8601 formatted timestamp of the step start time.

    completedAtstringrequired

    ISO 8601 formatted timestamp of the step completion time.

    statusstringrequired

    Last known status of the step. Available statuses are

    • 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)
  • ]
{
"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

    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 instance or 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-instance-status · 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