def _update_status(self, sub_job_num=None):
        """Gets the workflow status.

        Return:
            str: The current status of the workflow.

        """
        job_id = '%s.%s' % (self.cluster_id, sub_job_num) if sub_job_num else str(self.cluster_id)
        format = ['-format', '"%d"', 'JobStatus']
        cmd = 'condor_q {0} {1} && condor_history {0} {1}'.format(job_id, ' '.join(format))
        args = [cmd]
        out, err = self._execute(args, shell=True, run_in_job_dir=False)
        if err:
            log.error('Error while updating status for job %s: %s', job_id, err)
            raise HTCondorError(err)
        if not out:
            log.error('Error while updating status for job %s: Job not found.', job_id)
            raise HTCondorError('Job not found.')

        out = out.replace('\"', '').split('\n')


        status_code = 0
        for status_code_str in out:
            try:
                status_code = int(status_code_str.strip())
            except:
                pass

        log.info('Job %s status: %d', job_id, status_code)

        key = CONDOR_JOB_STATUSES[status_code]

        return key