     if upcomingSubjects.forWorkflow[workflow.id].length is 0
       # console.log 'Fetching subjects'
       subjectQuery =
-        project_id: project.id
         workflow_id: workflow.id
-        sort: 'cellect' unless SKIP_CELLECT
+        subject_set_id: subjectSet.id
+        sort: 'queued' unless SKIP_CELLECT
 
       fetchSubjects = apiClient.type('subjects').get subjectQuery
         .catch (error) ->

currentClassifications =
  forWorkflow: {}

# Quere up subjects to classify here.
# TODO: Should we clear this on sign-in and -out?
upcomingSubjects =
  forWorkflow: {}

        throw new Error "No workflow #{workflowID} for project #{project.id}"
      workflow

  getNextSubject: (project, workflow, subjectSet) ->
    # console.log 'Getting next subject for', workflow.id
    # Make sure a list of subjects exists for this workflow.
    upcomingSubjects.forWorkflow[workflow.id] ?= []
