@VisibleForTesting
    boolean isResponseTimedOut(TaskDef taskDefinition, TaskModel task) {
        if (taskDefinition == null) {
            LOGGER.warn(
                    "missing task type : {}, workflowId= {}",
                    task.getTaskDefName(),
                    task.getWorkflowInstanceId());
            return false;
        }

        if (task.getStatus().isTerminal() || isAyncCompleteSystemTask(task)) {
            return false;
        }

        // calculate pendingTime
        long now = System.currentTimeMillis();
        long callbackTime = 1000L * task.getCallbackAfterSeconds();
        long referenceTime =
                task.getUpdateTime() > 0 ? task.getUpdateTime() : task.getScheduledTime();
        long pendingTime = now - (referenceTime + callbackTime);
        Monitors.recordTaskPendingTime(task.getTaskType(), task.getWorkflowType(), pendingTime);
        long thresholdMS = taskPendingTimeThresholdMins * 60 * 1000;
        if (pendingTime > thresholdMS) {
            LOGGER.warn(
                    "Task: {} of type: {} in workflow: {}/{} is in pending state for longer than {} ms",
                    task.getTaskId(),
                    task.getTaskType(),
                    task.getWorkflowInstanceId(),
                    task.getWorkflowType(),
                    thresholdMS);
        }

        if (!task.getStatus().equals(IN_PROGRESS)
                || taskDefinition.getResponseTimeoutSeconds() == 0) {
            return false;
        }

        LOGGER.debug(
                "Evaluating responseTimeOut for Task: {}, with Task Definition: {}",
                task,
                taskDefinition);
        long responseTimeout = 1000L * taskDefinition.getResponseTimeoutSeconds();
        long adjustedResponseTimeout = responseTimeout + callbackTime;
        long noResponseTime = now - task.getUpdateTime();

        if (noResponseTime < adjustedResponseTimeout) {
            LOGGER.debug(
                    "Current responseTime: {} has not exceeded the configured responseTimeout of {} for the Task: {} with Task Definition: {}",
                    pendingTime,
                    responseTimeout,
                    task,
                    taskDefinition);
            return false;
        }

        Monitors.recordTaskResponseTimeout(task.getTaskDefName());
        return true;
    }
Updates the workflow output.

@param workflow the workflow instance
@param task if not null, the output of this task will be copied to workflow output if no
    output parameters are specified in the workflow definition if null, the output of the
    last task in the workflow will be copied to workflow output of no output parameters are
    specified in the workflow definition
core/src/main/java/com/netflix/conductor/core/execution/DeciderService.java