Tasks in the Spatial Analysis service execute asynchronously, meaning that you submit a request (or job) and then poll the service for status. When you submit a request, the Spatial Analysis service returns to you a unique job ID for the transaction. You can use the job ID to periodically check the status of the job and messages.
http://<analysis url>/arcgis/rest/services/tasks/GPServer/<task name>/jobs/<jobId>
The job will start with a status of esriJobSubmitted. When the job has successfully completed, the job status will change to esriJobSucceeded and the results will be populated. You can append the paramUrl from the results to the request with the job ID in order retrieve the results of the task.
jobStatus values
The jobStatus property can have the following values:
- esriJobSubmitted
- esriJobWaiting
- esriJobExecuting
- esriJobSucceeded
- esriJobFailed
- esriJobTimedOut
- esriJobCancelling
- esriJobCancelled