TickerQTickerQ
Guides

Job Chaining

Parent-child workflows with conditional execution.

Chain TimeTickerEntity jobs so children fire automatically based on how the parent completed.

Chaining is supported on TimeTicker only.

Run conditions

ConditionParent status
OnSuccessDone or DueDone
OnFailureFailed
OnCancelledCancelled
OnFailureOrCancelledFailed or Cancelled
OnAnyCompletedStatusAny terminal status
InProgressRuns in parallel with parent

Children do not need ExecutionTime — the scheduler fires them when the condition is met.


Direct chaining

var parent = new TimeTickerEntity
{
    Function      = "process-order",
    ExecutionTime = DateTime.UtcNow,
};

parent.Children.Add(new TimeTickerEntity
{
    Function     = "send-confirmation",
    ParentId     = parent.Id,
    RunCondition = RunCondition.OnSuccess,
});

parent.Children.Add(new TimeTickerEntity
{
    Function     = "alert-ops",
    ParentId     = parent.Id,
    RunCondition = RunCondition.OnFailure,
});

await timeTicker.AddAsync(parent);

Fluent builder

var chain = FluentChainTickerBuilder<TimeTickerEntity>
    .BeginWith(p =>
    {
        p.SetFunction("process-order")
         .SetExecutionTime(DateTime.UtcNow);
    })
    .WithFirstChild(c =>
        c.SetFunction("send-confirmation").SetRunCondition(RunCondition.OnSuccess))
    .WithSecondChild(c =>
        c.SetFunction("alert-ops").SetRunCondition(RunCondition.OnFailure))
    .Build();

await timeTicker.AddAsync(chain);

Supports up to 5 children and 5 grandchildren per child:

.WithFirstChild(c => c.SetFunction("charge").SetRunCondition(RunCondition.OnSuccess))
    .WithFirstGrandChild(gc =>
        gc.SetFunction("ship").SetRunCondition(RunCondition.OnSuccess))

When to use

ScenarioPattern
Sequential pipelineOnSuccess chain
Compensation on failureOnFailure branch
Notify regardless of outcomeOnAnyCompletedStatus
Parallel fan-outInProgress children

On this page