Get Workflow History

The Luma Automation API ‘Workflow History’ is used to get the execution status for a Luma Automation workflow. Based on the Workflow Trigger ID, the web service gets the workflow execution history information from Luma Automation. The API accepts the trigger ID generated using API and returns the latest workflow execution status as a response. Use the following details to configure API:

  1. Capture the tenant access token created during the Automation tenant provisioning. This token is sent as the Header to the API. Header → itas-api-access-key: <Tenant Access Token>.
    You can also use Regenerate Tenant Access Token API to regenerate and fetch the tenant access token.

  2. URI: /gateway/api/v1/workflowhistory/<Trigger ID>
    For Example: api/v1/workflowhistory/d9bf533e-cc29-4efe-a0e7-df4aef85cbc0

  3. HTTP Method for the operation: GET

  4. As a response, the web service generates the latest workflow history information for the Automation Workflow. Response from the web service is received in the following format:

    { "status": "Success", "statusCode": 0, "statusLine": "Successfully retrieved workflow history record.", "errors": null, "resultData": { "initiatorContactId": 1, "initiatorApplicationId": 0, "inputParameters": "{\"inputParameters\": [{\"value\": \"sample_input_value1\", \"caption\": null, \"dataType\": \"TEXT\", \"parameter\": \"sample_workflow_input_parameter1\", \"description\": null}, {\"value\": \"sample_input_value2\", \"caption\": null, \"dataType\": \"TEXT\", \"parameter\": \"sample_workflow_input_parameter2\", \"description\": null}]}", "startTime": 1641823983772, "endTime": 1641823988914, "timeSpent": 5142, "status": "RUNNING | SUSPENDED | ACTIVATED | COMPLETED | FAILED | TERMINATED", "href": "/api/v1/workflowHistory/427", "id": 427 }, "warnings": [], "timestamp": 1641879020256, "reasonPhrase": null, "metaInfo": null }
    1. ‘status’ represents the execution status of the API call. Success represents that the web service operation was successfully executed.

    2. ‘statusCode’ represents the status code.

    3. ‘statusLine’ represents the response message received from the web service. The message "Successfully retrieved workflow history record." represents that the workflow is successfully executed.

    4. ‘errors’ indicate the error received in case the workflow execution fails.

    5. ‘resultData’ section contains the details in the matching workflows. The following workflow details are received from the web service:

      1. ‘initiatorContactId’ is the Luma Id of the user who initiated the Automation workflow.

      2. ‘initiatorApplicationId’ represents the Application ID used to initiate the workflow.

      3. ‘inputParameters’ are the parameters used as inputs to execute the workflow. The section contains:

        1. ‘value’ is the parameter passed to the workflow to execute the process.

        2. ‘caption’ indicates the display name or caption of the input field.

        3. ‘dataType’ is the type of data required for the parameter such as TEXT, INTEGER, DECIMAL, BOOLEAN, etc.

        4. ‘parameter’ is the parameter name

        5. ‘description’ represents the Description of the Workflow

      4. ‘startTime’ represents the Automation workflow initiation time (Epoch time).

      5. ‘endTime’ represents the Automation workflow execution completion time (Epoch time)

      6. ‘timeSpent’ is the time spent in completing the workflow execution.

      7. ‘status’ represents the current workflow execution status. For example, RUNNING, SUSPENDED, ACTIVATED, COMPLETED, FAILED, TERMINATED, etc.

      8. ‘href’ contains the link to the Workflow execution history record.

      9. ‘id’ is the Luma ID of the Automation Workflow execution history record.

    6. 'warnings’ field contains any warning received from web service execution.

    7. ‘timestamp’ represents the time (Epoch time) of web service execution.

    8. ‘reasonPhrase’ represents the error, in case web service execution fails.

The ‘Workflow History’ API returns the overall execution status of the workflow. Get Workflow Step History Records API is used to fetch status of individual workflow step.