Description: Get the worker's run history.
Since: 7.90
Security: Admin user, project-admin or non-admin if the Worker is of Generic Event type and has been shared with non-admin users.
Usage:GET /worker/api/v1/execution_history
Produces: application/json; charset=utf-8
Header parameter: Authorization: Bearer
Sample Request
{
"workerKey": string,
"projectKey": string,
"showTestRun": boolean
}Request Parameters
Parameter | Datatype | Mandatory | Description |
|---|---|---|---|
| string | No | If set, it will only return the execution history for the given worker |
| boolean | No | If true, the test runs will also be returned. Test runs are the ones triggered by a user using the Run button in the Workers online editor or using the Worker Execute Test API. The default value is false. |
| string | No | If set, only history entries related to Workers attached to the given project will be returned.If a project admin token is used, this query parameter is required and the user must have the role project admin for the project, otherwise a HTTP error 403 is returned. |
Sample Usage
curl -X GET 'https://myserver.com/worker/api/v1/execution_history'
Sample Response
{
"workerKey": "test",
"workerType": "AFTER_DOWNLOAD",
"workerProjectKey": "",
"executionPayload": {...},
"executionStatus": "STATUS_SUCCESS",
"executionResult": {
"result": {...},
"logs": "[info ] - Artifactory ping success\n",
"workerStats": {
"cpuTimeMillis": 10,
"topMemoryUsageBytes": 1785856,
"executionDurationMillis": 5528
}
},
"startTimeMillis": 1747741357485,
"endTimeMillis": 1747741363041,
"triggeredBy": "artifactory",
"testRun": false,
"executedVersion": "1747741247465-admin",
"historyEntryId": "8c156053-0eeb-4560-b63b-ded7daa36ad7"
}Response Parameters
Parameter | Datatype | Description |
|---|---|---|
| string | The name of the Worker (unique ID). |
| Action | The action on which the Worker is hooked. It is an enum string of Action Enum (see below for available values). |
| string | Can be either |
| object | null | For event driven Workers this will be an object containing data about the event that triggered the Worker. For manual (http request) Workers, it will contain the data passed in the body of the HTTP request. Can be null if the body is not defined. |
| object | Contains what the Worker returned. In case of an uncaught exception, the |
| string | Containing the Worker’s script logs output. |
| number | The total calculation time performed by the worker’s script. |
| number | The top memory usage for this Worker. |
| number | The total execution time. |
| number | The time by which the execution started in milliseconds. |
| number | The time by which the execution ended in milliseconds. |
| string | Specifies who or what triggered the Worker. For a test run using the Run button in the online Workers editor, the value is For event-driven Workers, the service name that triggered the Worker is provided. For Generic Event Workers, the value is the username. |
| string | A string joining the timestamp at which the Worker was saved and the username (for example: |
| string | A unique identifier of the run. Can be used to call the rerun endpoint. |
| boolean | Indicates if this run was a test run (triggered using the Run button in the Edit page) or a real run. |
| string | The project key if it is a project scoped Worker or an empty string in case the Worker is global. |
Success Response Codes:
200: OK response. The execution history returned successfully.
Error Response Codes:
401 Invalid credentials.
403 Insufficient permissions.
409 Conflict with workerKey. Either the worker does not exist (if the workerKey query parameter is set) or the history storage is not connected.