public Optional<String> evaluateAndUploadLargePayload(
            Map<String, Object> taskOutputData, String taskType) {
        try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {
            objectMapper.writeValue(byteArrayOutputStream, taskOutputData);
            byte[] taskOutputBytes = byteArrayOutputStream.toByteArray();
            long taskResultSize = taskOutputBytes.length;
            MetricsContainer.recordTaskResultPayloadSize(taskType, taskResultSize);

            long payloadSizeThreshold =
                    conductorClientConfiguration.getTaskOutputPayloadThresholdKB() * 1024L;
            if (taskResultSize > payloadSizeThreshold) {
                if (!conductorClientConfiguration.isExternalPayloadStorageEnabled()
                        || taskResultSize
                                > conductorClientConfiguration.getTaskOutputMaxPayloadThresholdKB()
                                        * 1024L) {
                    throw new IllegalArgumentException(
                            String.format(
                                    "The TaskResult payload size: %d is greater than the permissible %d bytes",
                                    taskResultSize, payloadSizeThreshold));
                }
                MetricsContainer.incrementExternalPayloadUsedCount(
                        taskType,
                        ExternalPayloadStorage.Operation.WRITE.name(),
                        ExternalPayloadStorage.PayloadType.TASK_OUTPUT.name());
                return Optional.of(
                        uploadToExternalPayloadStorage(
                                PayloadType.TASK_OUTPUT, taskOutputBytes, taskResultSize));
            }
            return Optional.empty();
        } catch (IOException e) {
            String errorMsg = String.format("Unable to update task: %s with task result", taskType);
            LOGGER.error(errorMsg, e);
            throw new ConductorClientException(errorMsg, e);
        }
    }
Updates the result of a task execution. If the size of the task output payload is bigger than
{@link ConductorClientConfiguration#getTaskOutputPayloadThresholdKB()}, it is uploaded to
{@link ExternalPayloadStorage}, if enabled, else the task is marked as
FAILED_WITH_TERMINAL_ERROR.

@param taskResult the {@link TaskResult} of the executed task to be updated.
client/src/main/java/com/netflix/conductor/client/http/TaskClient.java