Table of Contents

Class StepOutputResolver

Namespace
FlowOrchestrator.Core.Expressions
Assembly
FlowOrchestrator.Core.dll

Resolves @steps('key').output.field, @steps('key').status, and @steps('key').error expressions against the persisted outputs of prior steps in the current run.

public sealed class StepOutputResolver
Inheritance
StepOutputResolver
Inherited Members

Remarks

Instances are scoped to a single step execution. Step output fetches are cached per step key so that multiple expressions referencing the same prior step incur only one GetStepOutputAsync(Guid, string) call.

Constructors

StepOutputResolver(IOutputsRepository, IFlowRunStore, Guid, StepCollection)

Initialises a resolver scoped to a single step execution.

public StepOutputResolver(IOutputsRepository outputsRepository, IFlowRunStore runStore, Guid runId, StepCollection steps)

Parameters

outputsRepository IOutputsRepository

Used to fetch outputs of prior steps.

runStore IFlowRunStore

Used to fetch step status and error message for .status and .error access.

runId Guid

The identifier of the current flow run.

steps StepCollection

The flow's step collection, used to validate that any referenced step key exists in the manifest.

Methods

IsStepExpression(string?)

Returns true when expression begins with @steps(.

public static bool IsStepExpression(string? expression)

Parameters

expression string

Returns

bool

Remarks

Fast-path: a string that doesn't start with @ at all (after at most a few leading whitespace characters) cannot be a step expression — return false without allocating a trimmed copy. This shortcut is what lets the resolver be called against every input value cheaply.

ResolveAsync(string)

Resolves the expression and returns the target value.

public ValueTask<object?> ResolveAsync(string expression)

Parameters

expression string

The raw expression string, e.g. @steps('fetch').output.orderId.

Returns

ValueTask<object>

The resolved value, or null when the referenced step has not yet produced output. Returns expression unchanged when it does not match the @steps() pattern.

Exceptions

FlowExpressionException

Thrown when the step key in the expression is not declared in the flow manifest.