Skip to content

Activity Nodes

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

Activity Nodes

Nodes are the vertices of a UML Activity graph. A node performs work, routes tokens, accepts an event, or defines an execution boundary. Flows connect the nodes and determine when and with what data a target can execute.

Node definition styles

Lambda-defined nodes use a string name and callbacks:

.AddAction(
    "Produce",
    async c => c.Output(42),
    node => node.AddFlow<int>("Handle"))
.AddAction("Handle", async c =>
{
    var value = c.GetTokensOfType<int>().Single();
    await processor.HandleAsync(value, c.CancellationToken);
})

Action nodes can also be defined as classes implementing IActionNode. Such actions can receive services and declared input/output token interfaces through constructor injection; see Action Node. Built-in UML node types such as FinalNode and DecisionNode<TToken> can be referenced with typed builder overloads instead of string names.

Node roles

Role Nodes
Entry, exit, and boundary Initial, Final, Input, Output
Executable work and event acceptance Action, Accept Event, Send Event, Publish Event, Time Event
Routing and synchronization Decision, Merge, Fork, Join
Data retention and nested execution Data Store, Structured, Iterative, Parallel Activity Nodes

Nodes are uniquely identified within their containing Activity scope. Nested nodes belong to their structured Activity, not to the containing graph's top-level namespace. Node defaults and how they affect activation and token reuse are described in Implicit Fork and Join.

Executable nodes and structured Activity nodes can also register exception handlers. See Activity Exception Handling for exception routing, matching, and examples.

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