Repository navigation
5.5.2.1.14. Data Store Node
A Data Store Node retains object tokens within the Activity instance and offers the stored tokens on its outgoing object flows when those flows are activated. It represents a UML data store, not a database or external persistence service; use application services for durable storage.
flowchart LR
start@{ shape: circle, label: " " }
start --> source(Receive measurement)
source -->|Measurement| store["<<datastore>><br/>Measurements"]
tick(Accept inspection event) --> inspect(Inspect stored measurements)
store -->|Stored measurements| inspect
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. The stereotyped object node represents a UML data store; it is not a database cylinder.
During an Orleans streaming busy period, a Data Store converts transactional arrivals to streamed provenance. Routing into it is therefore a handoff: the regular caller does not wait for later consumers of retained data to finish. Retained marking is durable only after natural quiescence or a successful checkpoint, not just because the input was admitted or a regular event returned.
.AddInitial(initial => initial.AddControlFlow("ReadMeasurement"))
.AddAction(
"ReadMeasurement",
async c => c.Output(await sensors.ReadAsync(c.CancellationToken)),
node => node.AddFlow<Measurement>("Measurements"))
.AddDataStore("Measurements", store => store
.AddFlow<Measurement>("Inspect"))
.AddAcceptEventAction<InspectMeasurements>(
"InspectTrigger",
async c => { },
node => node.AddControlFlow("Inspect"))
.AddAction("Inspect", async c =>
{
var stored = c.GetTokensOfType<Measurement>().ToArray();
await reports.RecordInspectionAsync(stored, c.CancellationToken);
})The store holds the values passed into it; each activation of its outgoing path can make the stored set available again. Its contents are part of the Activity's execution state, not automatically persisted to an external system. The default Data Store Node option enables implicit fork behavior so stored values can be made available to outgoing flows. See Tokens, Accept Event Action Node, and Implicit Fork and Join.
public sealed record Measurement(string SensorId, decimal Value);
public sealed record InspectMeasurements;Home page Support Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0. © by Mikołaj Milewski, 2026