/// <summary>
        /// Update the last processed time for a batch job in the config
        /// </summary>
        /// <returns></returns>
        private async Task <Result> UpdateLastProcessedTime(FlowConfig config, int index, long value)
        {
            var existingFlow = await FlowData.GetByName(config.Name).ConfigureAwait(false);

            Result result = null;

            if (existingFlow != null)
            {
                var gui = config.GetGuiConfig();

                var batch = gui.BatchList[index];
                batch.Properties.LastProcessedTime = value.ToString(CultureInfo.InvariantCulture);

                config.Gui = JObject.FromObject(gui);
                result     = await FlowData.UpdateGuiForFlow(config.Name, config.Gui).ConfigureAwait(false);
            }

            return(result);
        }
        /// <summary>
        /// Disable a batch job in the config
        /// </summary>
        /// <returns></returns>
        private async Task <Result> DisableBatchConfig(FlowConfig config, int index)
        {
            var existingFlow = await FlowData.GetByName(config.Name).ConfigureAwait(false);

            Result result = null;

            if (existingFlow != null)
            {
                var gui = config.GetGuiConfig();

                var batch = gui.BatchList[index];
                batch.Disabled = true;

                config.Gui = JObject.FromObject(gui);
                result     = await FlowData.UpdateGuiForFlow(config.Name, config.Gui).ConfigureAwait(false);
            }

            return(result);
        }