Skip to content

5.5.2.1. Nodes

Mikołaj Milewski edited this page Nov 12, 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 Pin, Output Pin
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

Node names are globally unique across an Activity, including nested scopes. Ordinary node names are registered as supplied; Initial Nodes and input pins use scope-qualified generated names. Output pins and Final Nodes can be given distinct names when their defaults would collide. Node defaults and how they affect activation and token reuse are described in Implicit Fork and Join.

Typed boundaries use AddInputPin<TToken> and AddOutputPin<TToken>. Each declared type is a distinct pin, represented by NodeType.InputPin or NodeType.OutputPin. Their IPinContext metadata exposes TokenType, name, parent, and connected flows. Containing node contexts expose scoped InputPins and OutputPins collections. OutputPin<TToken> targets an output pin that uses its default name. A custom output-pin name is targeted with the string flow overload; see the Input Pin and Output Pin pages.

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

Clone this wiki locally