static function isWorkflowInErrorState($workflow_key, $error_ttl) {
        $status = self::STATUS_FAILED;
        $created_after = "-$error_ttl seconds";
        $data = DataStore::retrieveMostCurrentWorkflowJobByAgeAndStatus($workflow_key, $status, $created_after);
        return (bool)$data;
    }