Repository navigation
Activity Tokens
Activity tokens are typed values that travel on object flows. They are the application data carried through an Activity; control flows carry control only. An action produces tokens with Output or OutputRange and reads routed inputs with GetTokensOfType<TToken>().
flowchart LR
produce(Produce values) -->|int tokens| select{Decision}
select -->|even| sum(Sum values)
select -->|else| report(Report values)
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. Mermaid does not provide native Activity node semantics.
.AddInitial(node => node.AddControlFlow("Produce"))
.AddAction(
"Produce",
async c => c.OutputRange(new[] { 2, 5, 8 }),
node => node.AddFlow<int, DecisionNode<int>>())
.AddDecision<int>(decision => decision
.AddFlow("SumEven", flow => flow
.AddGuard(async c => c.Token % 2 == 0))
.AddElseFlow("ReportOther"))
.AddAction("SumEven", async c =>
{
var values = c.GetTokensOfType<int>();
await reports.WriteSumAsync(values.Sum(), c.CancellationToken);
})
.AddAction("ReportOther", async c =>
await reports.WriteValuesAsync(
c.GetTokensOfType<int>(), c.CancellationToken))The generic argument on AddFlow<TToken> describes the object type carried by that edge. A flow guard can filter tokens; a transformation can change the type before they reach the target. Tokens may also be forwarded using PassTokensOfTypeOn<TToken>() or PassAllTokensOn() where the node/context API supports it.
Structured nodes pass selected parent tokens through Input Nodes, and return data through Output Nodes. Use a Data Store Node when a graph must retain tokens across later activations. See Data Flow and Implicit Fork and Join for routing and token reuse semantics.
Home page Support Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0. © by Mikołaj Milewski, 2026
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