using Elsa.Workflows.Management.Entities;
namespace Elsa.Workflows.Runtime.Options;
///
/// Provides options to the workflow runtime.
///
public class RuntimeOptions
{
///
/// A list of workflow builders configured during application startup.
///
public IDictionary>> Workflows { get; set; } = new Dictionary>>();
///
/// The default workflow liveness threshold.
///
///
/// The liveness threshold is used to determine if a persisted workflow instance in the state should be considered interrupted or not.
/// Interrupted workflows will be attempted to be restarted.
/// A separate heartbeat process will ensure the is updated before this threshold.
/// If the workflow instance got removed from memory, e.g. because of an application shutdown, the LastUpdated field will eventually exceed the liveness threshold and therefore be considered to be interrupted.
///
public TimeSpan WorkflowLivenessThreshold { get; set; } = TimeSpan.FromMinutes(5);
///
/// The number of workflow instances to restart in a single batch.
///
///
/// The batch size represents the number of workflow instance records to load into memory at a time.
/// This provides control over memory consumption of the application.
///
public int RestartInterruptedWorkflowsBatchSize { get; set; } = 100;
}