ReferenceFlightcontrol APIScheduler ServiceGet Job Execution

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

MethodPath
GET/v1/job-executions/{executionId}
Headers
AuthorizationBearer: [API key]
Parameters
ParameterTypeDescription
executionIdstringThe 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

FieldTypeDescription
idstringThe unique identifier of the job execution
statusstringCurrent status of the execution (see statuses below)
createdAtstring (ISO)When the execution was created
finishedAtstring | nullWhen the execution finished (null if still running)
exitCodenumber | nullExit code of the job (null if not finished)
errorobject | nullError details if the execution failed
job.idstringThe unique identifier of the job
job.givenIdstringThe user-defined identifier of the job

Statuses

StatusDescription
INITIALIZINGJob execution is being set up
IN_PROGRESSJob is currently running
COMPLETEDJob finished successfully
CANCELLINGJob cancellation has been requested
CANCELLEDJob was cancelled before completion
ERRORJob 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"