Skip to content

Activity Initial Node

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

Initial Node

An Initial Node identifies an Activity's entry point. It has no incoming flow and emits control along its outgoing flows when the Activity execution is initialized. UML notation is a small filled circle.

Definition

.AddInitial(initial => initial
    .AddControlFlow("LoadOrder"))
.AddAction(
    "LoadOrder",
    async c => c.Output(await orders.LoadAsync(
        orderId, c.CancellationToken)),
    node => node.AddFlow<Order>("CheckInventory"))
.AddAction("CheckInventory", async c =>
    await inventory.CheckAsync(
        c.GetTokensOfType<Order>().Single(), c.CancellationToken))

Stateflows permits one Initial Node per Activity scope; repeated AddInitial calls in that scope are rejected. Give that node multiple outgoing control flows when initialization should enable several paths. A nested structured Activity has its own scope and may declare its own Initial Node.

An Input Node instead routes incoming application tokens. A path driven solely by input tokens can start from Input without Initial; use initial control when work must begin during initialization independently of supplied tokens. See Final Node and Activities.

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