Flow Studio
NodeExecutionEventArgs
The data bag passed to every subscriber method. It carries identity, context, timing, result, and error information — exactly what is available depends on which lifecycle event fired.
Class Definition
public sealed class NodeExecutionEventArgs
{
// Identity
public string NodeId { get; init; }
public string NodeType { get; init; } // TypeCode, e.g. "HttpRequest"
public string ExecutionId { get; init; }
public string ProcessId { get; init; }
public string TenantId { get; init; }
// Context snapshot (read-only copy — mutations have no effect)
public IReadOnlyNodeExecutionContext Context { get; init; }
// Timing
public DateTimeOffset StartedAt { get; init; }
public long? DurationMs { get; init; } // null in OnBefore
// Result (only set in OnAfter)
public NodeExecutionResult? Result { get; init; }
// Error (only set in OnError)
public Exception? Exception { get; init; }
public int RetryCount { get; init; }
// Skip (only set in OnSkipped)
public SkipReason SkipReason { get; init; }
}
Property Availability by Event
| Property | OnBefore | OnAfter | OnError | OnSkipped |
|---|---|---|---|---|
NodeId | Yes | Yes | Yes | Yes |
NodeType | Yes | Yes | Yes | Yes |
ExecutionId | Yes | Yes | Yes | Yes |
ProcessId | Yes | Yes | Yes | Yes |
TenantId | Yes | Yes | Yes | Yes |
Context | Yes | Yes | Yes | Yes |
StartedAt | Yes | Yes | Yes | Yes |
DurationMs | null | Set | Set | null |
Result | null | Set | null | null |
Exception | null | null | Set | null |
RetryCount | 0 | 0 | Current count | 0 |
SkipReason | None | None | None | Set |
Context Snapshot
The Context property exposes an IReadOnlyNodeExecutionContext — a deep copy of the execution context at the moment the event fired. It gives access to:
Context.ExecutionMemory— read the outputs of upstream nodesContext.NodeConfig— the node's configured settingsContext.ActorId— the user or system that triggered executionContext.TriggerPayload— the original trigger data
Snapshot, not live: Writing to
Context.ExecutionMemory or any other Context property has no effect on the actual execution. The context passed to subscribers is a frozen copy.
SkipReason Enum
public enum SkipReason
{
None,
ConditionalBranchNotTaken, // Edge condition evaluated to false
ParallelPathNotActive, // Node is on a parallel branch that wasn't chosen
LoopIterationSkipped, // Loop body skipped for this iteration
ManuallyDisabled // Node was disabled in the designer
}
Accessing NodeType
The NodeType string is the TypeCode string registered by the executor — e.g. "HttpRequest", "Approval", "SetVariable". Use it to filter your subscriber to specific node types:
public async Task OnErrorAsync(NodeExecutionEventArgs args, CancellationToken ct)
{
// Only alert for HTTP failures, not for all node errors
if (args.NodeType != "HttpRequest") return;
await _alerts.SendAsync($"HTTP node {args.NodeId} failed: {args.Exception!.Message}", ct);
}