Skip to content

Activity Input Node

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

Input Node

An Input Node exposes tokens arriving at an Activity boundary to nodes inside that graph. At the top level, tokens arrive through IActivityBehavior.SendInputAsync; inside a structured node, they arrive from the containing graph. It has no incoming edge in its own scope: declare forwarded token types with AddInput(input => input.AddFlow<TToken>(target)).

flowchart LR
    parent(Parent Activity) -->|Order| input["Input boundary"]
    subgraph nested["Structured Activity"]
        input --> calculate(Calculate total)
    end
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. Input/Output boxes name Stateflows boundary APIs, not UML final nodes or a claim that UML uses these box labels. Mermaid does not model pins, activity parameters, or expansion regions natively.

Definition

.AddInitial(initial => initial.AddControlFlow("LoadOrder"))
.AddAction(
    "LoadOrder",
    async c => c.Output(await orders.LoadAsync(
        orderId, c.CancellationToken)),
    node => node.AddFlow<Order>("CalculateTotal"))
.AddStructuredActivity("CalculateTotal", nested => nested
    .AddInput(input => input.AddFlow<Order>("Calculate"))
    .AddInitial(initial => initial.AddControlFlow("Calculate"))
    .AddAction("Calculate", async c =>
    {
        var order = c.GetTokensOfType<Order>().Single();
        c.Output(order.Lines.Sum(line => line.Price * line.Quantity));
    }, node => node.AddFlow<decimal, OutputNode>())
    .AddOutput())

The nested input declaration does not create an application token; it forwards matching parent inputs along its object flows. Use AddInitial separately to begin control execution in the nested graph. For nested results, connect an inner producer to OutputNode and declare AddOutput(). See Structured Activity Node, Output Node, and Data Flow.

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