Skip to content

Activity Join Node

Mikołaj Milewski edited this page Oct 27, 2026 · 1 revision

Join Node

A Join Node synchronizes incoming flows before allowing its outgoing flow to continue. In UML, the bar-shaped join waits for the required incoming control/object flows; it is distinct from a Merge Node, which passes alternative arrivals through without synchronization.

flowchart LR
    start@{ shape: circle, label: " " }
    start --> item(Load items)
    start --> address(Validate address)
    item --> sync
    address --> sync
    sync[ ]:::bar
    sync --> ship(Dispatch order)
    classDef bar fill:#000,stroke:#000
Loading

Mermaid approximation: this diagram shows the model's routing, not a complete UML Activity notation. Rounded boxes represent actions; edge labels identify token types or guards. The black rectangle approximates a UML fork/join bar; its exact proportions depend on Mermaid rendering.

Definition

.AddInitial(node => node
    .AddControlFlow("LoadItems")
    .AddControlFlow("ValidateAddress"))
.AddAction(
    "LoadItems",
    async c => c.OutputRange(await orders.LoadItemsAsync(orderId, c.CancellationToken)),
    node => node.AddFlow<Item, JoinNode>())
.AddAction(
    "ValidateAddress",
    async c => c.Output(await addresses.ValidateAsync(orderId, c.CancellationToken)),
    node => node.AddFlow<AddressCheck, JoinNode>())
.AddJoin(join => join
    .AddFlow<Item>("DispatchOrder")
    .AddFlow<AddressCheck>("DispatchOrder"))
.AddAction("DispatchOrder", async c =>
    await shipping.DispatchAsync(
        c.GetTokensOfType<Item>(),
        c.GetTokensOfType<AddressCheck>().Single(),
        c.CancellationToken))

Configure each incoming flow explicitly so the Join receives the required arrivals. The Join forwards tokens onward; the target can read the input token types after synchronization. Do not substitute a Join where every arriving branch should proceed independently: use a Merge Node for that. See also Implicit Fork and Join.

Overview
Installation
Runtimes
   Orleans runtime
Concepts
   Events and Structural Events
   Messaging Patterns
   Validation
   Scheduling
   Observability
Behaviors
   Behavior Values
   Dependency Injection
   Behavioral Groups
   State Machines
       Concepts
           State Identity
           In-State Event Deferrals
           Evaluation of Transitions
           Exception Handling
       Building blocks
           Regions
           States
               State
               Composite State
               Orthogonal State
               Final State
           Pseudostates
               Choice
               Junction
               Fork
               Join
               History
           Transitions
               Transition
               Default Transition
               Internal Transition
   Activities
       Concepts
           Exception Handling
           Implicit Fork and Join
           Tokens
       Building blocks
           Nodes
               Action Node
               Decision Node
               Merge Node
               Initial Node
               Final Node
               Input Node
               Output Node
               Fork Node
               Join Node
               Accept Event Action Node
               Send Event Action Node
               Publish Event Action Node
               Time Event Action Node
               Data Store Node
               Structured Activity Node
               Iterative Activity Node
               Parallel Activity Node
           Flows
               Data Flow
               Control Flow
   Actions
   Entities
       Fields
       Mutations
       Projections
Extensions
   ClearScript
   FluentValidation
   JSON definitions
   Minimal APIs
   OneOf
   OpenTelemetry
   PlantUML
   Scheduling

Clone this wiki locally