Overview
This API endpoint is used to retrieve the current status of the Flow, even when the Flow is currently running.
Authentication
Before making a call to the built-in API, the user must receive a JWT token from the authentication API.
Step 1. Use any user with the Operator
, Editor
, or Administrator
role to call Etlworks authentication endpoint and receive an access token.
Step 2. Use the access token received in Step 1 to call Etlworks API endpoints. The access token must be submitted as a header parameter, as in: Authorization:Bearer access-token
.
Access tokens in Etlworks are short-lived and self-expiring. An access token gives you access to the APIs for approximately 10 minutes. It is recommended that you refresh the access token before each call to the API.
The API endpoint parameters
- PATH:
/rest/v1/executions/{flowid}?optional_parameters
- LEGACY PATH (we keep it for backward compatibility):
/plugins/dashboard/rest/v1/flows/{flowid}?optional_parameters
EXAMPLE: https://app.etlworks.com/rest/v1/executions/1234
flowId=long
. The Flow ID can be found in the Flows.
- METHOD:
GET
- HEADER:
Authorization:Bearer access-token
- PARAMETERS:
messageId=UUID
. Example: https://app.etlworks.com/rest/v1/executions/1234?messageId=15a20488-0224-4ae1-a52c-9ee65a69f2c5
. If the value of the optional parameter messageId
is not empty, the response will contain a status of the Flow execution, associated with the particular message ID. The message ID is returned as a part of the response when the Flow is executed by sending the payload to the custom endpoint.
auditId=long
. Example: https://app.etlworks.com/rest/v1/executions/1234?auditId=1234567
. If the value of the optional parameter auditId
is not empty, the response will contain a status of the Fllow execution, associated with the particular audit ID. The audit ID is returned as a part of the response when the Flow is executed by name.
status=string
. Example: https://app.etlworks.com/rest/v1/executions/1234?status=success
. Use this parameter to get the last Flow execution with the specified status.
- REQUEST BODY: none
- REQUEST CONTENT TYPE: none
Response
The response is a JSON document in the following Format:
{
"auditId": long, // unique audit ID
"parentAuditId": long, // parent audit ID if there were auto-retry attempts when executing the flow. Null if there were no auto-retry attempts
"retries": integer,// number of retries or null
"flowId": long, // flow ID
"flowName": "string", // flow name
"eventId": long, // scheduled event ID
"eventName": "string", // name of the scheduled event or null if flow has not been scheduled
"messageId": "UUID", // message ID when flow has been executed by sending payload to the custom endpoint, otherwise null
"tenantId": long, // tenant id if flow was executed by super-admin user, otherwise null
"status": "string", // status of the flow execution: success, warning, error, running
"triggerType": "string", // flow.execution.scheduler or flow.execution.on.demand or null
"startedBy": "string", // who triggered the flow: scheduler, or user login name
"started": long, // start time in milliseconds
"ended": 1531158790495, // end time in milliseconds. Only available if flow has been already executed
"duration": "string", // human readable duration of the flow. Only available if flow has been already executed
"code": "string", // last executed SQL statement in case of error, or null. Only available if flow has been already executed
"exception": "string", // exception stack-trace or/end messages logged by the user using etlConfig.log(message). Only available if flow has been already executed
"warnings": "string", // warnings or null. Only available if flow has been already executed
"metrics": [metrics], // flow metrics or null. Only available if flow has been already executed
"fileMetrics": [file metrics], // file metrics or null. Only available if flow has been already executed
"errorLocationInSql": integer, // line number in last executed SQL in case of error, or null. Only available if flow has been already executed
"fileName": null, // currently not used
"records": 1 // currently not used
}
Response Codes
- 200 for success
- 401 and 403 for not authorized
- 404 when Flow execution wasn't found
- 500 for an internal error
Comments
0 comments
Please sign in to leave a comment.