Get Job Execution API
Use this API to check the status of a job execution that was triggered in a Flightcontrol managed scheduler service.
API Description
| Method | Path |
|---|---|
| GET | /v1/job-executions/{executionId} |
| Headers | |
|---|---|
| Authorization | Bearer: [API key] |
| Parameters | ||
|---|---|---|
| Parameter | Type | Description |
executionId | string | The job execution unique id returned from Create Job Execution. |
Full Endpoint URL https://api.flightcontrol.dev/v1/job-executions/{executionId}
Response Example
{
"id": "cl2kx7acm00003f6gobvidq2i",
"status": "COMPLETED",
"createdAt": "2024-01-15T10:30:00.000Z",
"finishedAt": "2024-01-15T10:35:00.000Z",
"exitCode": 0,
"error": null,
"job": {
"id": "job-abc123",
"givenId": "my-scheduled-job"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
id | string | The unique identifier of the job execution |
status | string | Current status of the execution (see statuses below) |
createdAt | string (ISO) | When the execution was created |
finishedAt | string | null | When the execution finished (null if still running) |
exitCode | number | null | Exit code of the job (null if not finished) |
error | object | null | Error details if the execution failed |
job.id | string | The unique identifier of the job |
job.givenId | string | The user-defined identifier of the job |
Statuses
| Status | Description |
|---|---|
INITIALIZING | Job execution is being set up |
IN_PROGRESS | Job is currently running |
COMPLETED | Job finished successfully |
CANCELLING | Job cancellation has been requested |
CANCELLED | Job was cancelled before completion |
ERROR | Job failed with an error |
Response Conditions
Success
Errors
Example Usage
After creating a job execution with the Create Job Execution API, you can poll for its status:
# First, trigger a job execution
curl -X POST https://api.flightcontrol.dev/v1/services/{serviceId}/job/{jobGivenId}/execution \
-H "Authorization: Bearer: YOUR_API_KEY" \
-H "Content-Type: application/json"
# Response: {"jobExecutionId": "cl2kx7acm00003f6gobvidq2i"}
# Then, check the status
curl https://api.flightcontrol.dev/v1/job-executions/cl2kx7acm00003f6gobvidq2i \
-H "Authorization: Bearer: YOUR_API_KEY"