Table of Contents

Interface IWorkflowBuilder<TData>

Namespace
Millrace.Workflows
Assembly
Millrace.dll

The code-first fluent surface a definition builds itself with (ARCHITECTURE.md §6.1).

public interface IWorkflowBuilder<TData>

Type Parameters

TData

Remarks

Every method appends to the current sequence and returns the same builder, so a definition reads top to bottom. Branch bodies get their own nested builder, which is how the graph gets its structure without the caller handling node ids.

Methods

Delay(TimeSpan)

Suspends for duration, as a Layer 1 scheduled job carrying a resume token.

ForEach<TItem>(Expression<Func<TData, IEnumerable<TItem>>>, Action<IWorkflowBuilder<TData>>)

Runs body once per item of a collection selected from the document.

If(Expression<Func<TData, bool>>, Action<IWorkflowBuilder<TData>>, Action<IWorkflowBuilder<TData>>?)

Branches on a predicate over the data document.

Parallel(params Action<IWorkflowBuilder<TData>>[])

Runs branches concurrently, each as its own chain of jobs, and continues once all complete.

Saga(Action<ISagaBuilder<TData>>)

A sequence whose completed steps are undone in reverse order if a later one fails past its retry policy (§6.4).

StartWith<TActivity>()

Appends an activity. Identical to Then<TActivity>() — it exists so a definition can open with the word that reads correctly.

Then<TActivity>()

Appends an activity to the current sequence.

WaitForSignal<TPayload>(string, Expression<Func<TData, string>>, Action<TData, TPayload>, TimeSpan?)

Suspends until a correlated signal arrives, binding its payload into the document.