Edit

OperationChain class

Namespace: Microsoft.Azure.Workflows.Sdk

OperationChain represents a directed chain of workflow operations, tracking a start node and one or more end nodes. It is the result of every Then() call and supports combining parallel branches that share the same root.

Usage

var trigger = WorkflowTriggers.BuiltIn.CreateHttpTrigger();
var left = trigger.Then(WorkflowActions.BuiltIn.Compose(inputs: () => "Left").WithName("Left"));
var right = trigger.Then(WorkflowActions.BuiltIn.Compose(inputs: () => "Right").WithName("Right"));

// Join two chains that share the same trigger root
var joined = left.Join(right);

// Fan-in: add an action after both branches
joined.Then(WorkflowActions.BuiltIn.Compose(inputs: () => "Merged").WithName("Merged"));

WorkflowFactory.CreateStatefulWorkflow("fanInWorkflow", trigger);

Methods

Join

Combines this chain with another OperationChain that shares the same root operation, producing a single chain with unified end nodes. Use this method to merge independently built branches before continuing with additional actions.

public OperationChain Join(OperationChain other)
Name Description Type Required
other The chain to join with. Must share the same start node. OperationChain Yes
var trigger = WorkflowTriggers.BuiltIn.CreateHttpTrigger();
var branch1 = trigger.Then(WorkflowActions.BuiltIn.Compose(inputs: () => "A").WithName("BranchA"));
var branch2 = trigger.Then(WorkflowActions.BuiltIn.Compose(inputs: () => "B").WithName("BranchB"));

// Merge both branches
OperationChain merged = branch1.Join(branch2);

// Continue after both branches complete
merged.Then(WorkflowActions.BuiltIn.Response(
    responseBody: () => "Both branches done").WithName("FinalResponse"));

Then

This type implements Then() methods from IChainableNode. See that page for full documentation of all overloads.