Skip to content

Choreography options reference

Options classSupplied throughMutability
CratisChoreographyOptionsThe argument of AddCratisChoreographyInit-only
JobsOptionsA registered IOptions<JobsOptions> instanceInit-only
WorkflowsOptionsCratisChoreographyOptions.ConfigureWorkflows or the configure callback of AddCratisChoreographyWorkflowsSettable
EventSourcedWorkflowsOptionsThe configure callback of AddEventSourcedWorkflowsSettable
EventSourcedStateMachinesOptionsThe configure callback of AddEventSourcedStateMachinesSettable
PatchingOptionsCratisChoreographyOptions.ConfigurePatching or the configure callback of AddCratisChoreographyPatchingSettable
MongoDBJobsStorageOptionsThe configure callback of AddCratisChoreographyMongoDBJobsStorageSettable
MongoDBPatchStorageOptionsThe configure callback of AddCratisChoreographyMongoDBPatchStorageSettable
SqlJobsStorageOptionsThe required configure callback of AddCratisChoreographySqlJobsStorageSettable
SqlPatchStorageOptionsThe required configure callback of AddCratisChoreographySqlPatchStorageSettable

Namespace Cratis.Choreography.Hosting. See Host the Choreography silo.

OptionDefaultMeaning
EnabledtrueWhen false, AddCratisChoreography configures nothing.
ClusteringClusteringMode.LocalhostLocalhost clustering, or durable MongoDB cluster membership.
ClusterId"default"The cluster id every instance joins.
ServiceId"default"The service id every instance joins.
DatabaseName"orleans"The MongoDB database for cluster membership and, with MongoDB storage, the grain storage providers.
ConnectionString"mongodb://localhost:27017"The MongoDB connection string used for clustering and grain storage.
StorageGrainStorageMode.MongoDBWhere grain state lives. InMemory keeps jobs, job steps and workflow runs in the silo’s memory.
WorkflowsfalseHosts the workflow engine: its grain storage, journal, sweep and node execution.
ConfigureWorkflowsnullConfigures WorkflowsOptions when Workflows is on.
PatchingfalseApplies patches when the silo becomes Active. With in-memory storage, the applied-patch record is in memory too.
ConfigurePatchingnullConfigures PatchingOptions when Patching is on.

CratisChoreographyOptions.Local() returns Clustering = Localhost and Storage = InMemory.

EnumValueMeaning
ClusteringModeLocalhost (0)Localhost clustering for a single instance.
ClusteringModeMongoDB (1)Durable MongoDB cluster membership for more than one instance.
GrainStorageModeMongoDB (0)Durable grain state in MongoDB.
GrainStorageModeInMemory (1)Grain state in memory for one silo; nothing survives the process.

Namespace Cratis.Choreography.Jobs. Values below 1 are treated as 1 for MaxConcurrentRehydration, MaxConcurrentCleanup, MaxTerminalJobsPerCleanup, MaxConcurrentStepStarts, MaxActiveStepsPerJob, MaxStepAttempts and StepDeliveryMaxAttempts.

OptionDefaultMeaning
MaxParallelStepsnullSteps one silo runs at once. GetEffectiveMaxParallelSteps() returns it, or the processor count minus 1 with a minimum of 1.
DeadJobThreshold1 hourHow old a job stuck in preparation with no steps must be before cleanup removes it.
CleanupCadence1 hourHow often the scavenger looks for dead jobs.
MaxInlineStepPlanSize1,048,576 bytesSerialized size of a job’s whole step plan above which the plan is kept outside the job document, when storage and every silo support it. Zero keeps every plan outside whenever possible.
StepCheckpointBatchInterval100Reported batches a step accumulates before its progress checkpoint is persisted.
StepCheckpointFlushInterval5 secondsHow long a step may hold an unpersisted checkpoint before it is flushed; zero or less disables the timed flush.
MaxConcurrentRehydration8Stored jobs resumed at once when the jobs manager rehydrates, oldest first.
MaxConcurrentCleanup4Dead jobs the cleanup deletes at once.
TerminalJobRetention7 daysHow long completed and failed jobs stay before cleanup removes them with their steps; Timeout.InfiniteTimeSpan keeps them.
MaxTerminalJobsPerCleanup100Most terminal jobs selected, oldest first, in one cleanup pass.
MaxConcurrentStepStarts16Steps of one job started at once when it starts or resumes.
MaxActiveStepsPerJobnullSteps of one job active at once; null starts every step up front. Job.MaxActiveSteps overrides it per job.
MaxStepAttempts1Attempts before a step’s failure counts as the job’s; 1 never retries. Job.ShouldRetryStep decides per failure.
StepRetryBackoff5 secondsDelay before the second attempt of a failed step; each further attempt doubles it.
MaxStepRetryBackoff5 minutesLongest delay between two attempts of a step.
JobWatchdogInterval1 minuteHow often a running job counts its steps in storage, finalizes itself when all are done and retries a failed resume hook; zero, negative or infinite turns it off.
StepLeaseTimeoutzeroHeartbeat silence after which the watchdog may restart a step whose owner silo has left the cluster; zero, negative or infinite turns leases off.
StepDeliveryMaxAttempts10Times a step delivers its persisted outcome to its job before leaving it to the job’s watchdog.
StepDeliveryRetryDelay1 secondDelay before the second delivery of a step outcome; each further delivery doubles it.
MaxStepDeliveryRetryDelay30 secondsLongest delay between two deliveries of a step outcome.
StepStopTimeout10 secondsHow long stopping a step waits for its work to settle before it answers JobStepError.StopTimedOut. Keep it below the Orleans response timeout.

Namespace Cratis.Choreography.Workflows. See Host and start workflows.

OptionDefaultMeaning
JobsScope"workflows"Scope of the jobs manager that holds a run’s wave jobs, for the default IWorkflowExecutionScopes.
Scopesempty setScopes the sweep and wave-job recovery act on, besides those an IWorkflowScopeSource names and those the silo has seen.
WakeRunsItselftrueWhile a retry or wait deadline is pending, the run’s grain keeps a timer and a reminder to act on time.
SweeptrueWhether the sweep runs on this silo.
SweepInterval30 secondsHow often the sweep asks every active run of every known scope whether it has work.
SweepStartupDelay20 secondsDelay after the sweep starts before its first pass.
IdleBeforeResume15 minutesHow long a run may be idle before the sweep takes it forward from its recorded history.

Namespace Cratis.Choreography.Chronicle.Workflows. See Chronicle journal and triggers.

OptionDefaultMeaning
EventStore"Default"Event store that run facts are appended to.
NamespaceForthe scope’s valueMaps a WorkflowScope to an event store namespace.
ScopeForthe namespace’s valueMaps an event store namespace back to a WorkflowScope, for event triggers.
ReadModelstrueMaintains the run listing and open waits as read models.
EventTriggersempty, read-onlyThe event triggers declared so far.
Schedulesempty, read-onlyThe schedules declared so far.
OnEvent<TEvent>(workflow, trigger)noneDeclares that an event admits a run of a workflow.
Schedule(schedule)noneDeclares that a workflow starts on a schedule.

Namespace Cratis.Choreography.Chronicle.StateMachines. See Event-sourced state machines.

OptionDefaultMeaning
DiscovertrueDiscovers every concrete EventSourcedStateMachine<TModel> by type discovery.
StateMachinesempty setState machine types registered in addition to the discovered ones.
ModelCatchUpTimeout30 secondsHow long a delivered event waits for a materialized model to catch up before the delivery fails. A passive model never waits.
ModelCatchUpPollInterval50 millisecondsHow often a materialized model is checked while waiting.

Namespace Cratis.Choreography.Patching. See Patching and the patching reference.

OptionDefaultMeaning
HostVersionnullVersion of the running host. When null, the informational version of the entry assembly without build metadata, falling back to its assembly version. An unset or 1.0.0 version is unknown: patches apply, but the store is not marked.
MaxAttempts5Times the host asks the patch manager to apply patches while waiting for it to move to a host at least as new, before the start fails.
RelocationDelay1 secondWait before asking again; it doubles after every attempt, up to 30 seconds.
MaxWait15 minutesLongest a host keeps asking while calls fail transiently (response timeout, silo lost, message rejected) before PatchingDidNotComplete.

Namespace Cratis.Choreography.Storage.MongoDB. See MongoDB storage.

OptionDefaultMeaning
DatabaseNameResolvernullFunction of scope and namespace that returns the database name. When null, DatabaseNames.ForJobs applies: {scope}+jobs, or {scope}+jobs+{namespace}.
TransientRetryCount5Retries after a transient error (wait queue full, timeout, connection failure); zero disables retrying.
TransientRetryBaseDelay200 millisecondsDelay before the first retry; it doubles each retry and is randomized.

Namespace Cratis.Choreography.Storage.MongoDB.

OptionDefaultMeaning
DatabaseName"choreography"The one database that holds the patch records for the whole store.

Namespace Cratis.Choreography.Storage.Sql. See SQL storage.

OptionDefaultMeaning
OptionsResolverrequiredFunction of scope and namespace that returns the DbContextOptions<JobsDbContext>, which also picks the EF Core provider.

Namespace Cratis.Choreography.Storage.Sql.

OptionDefaultMeaning
OptionsResolverrequiredFunction that returns the DbContextOptions<PatchesDbContext>, which picks the database and the EF Core provider.