SpanFlow.Expressions 1.0.0

dotnet add package SpanFlow.Expressions --version 1.0.0
                    
NuGet\Install-Package SpanFlow.Expressions -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SpanFlow.Expressions" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SpanFlow.Expressions" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SpanFlow.Expressions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SpanFlow.Expressions --version 1.0.0
                    
#r "nuget: SpanFlow.Expressions, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SpanFlow.Expressions@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SpanFlow.Expressions&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SpanFlow.Expressions&version=1.0.0
                    
Install as a Cake Tool

SpanFlow.Expressions

The expression and {{ template }} language that SpanFlow pipelines use, packaged as a library. It reads JSON (System.Text.Json.Nodes) and is deliberately not a scripting engine: an expression can read paths, compare values, combine them with &&, || and ! and call exists(), and nothing else. You can evaluate templates written by your users without running their code.

using System.Text.Json.Nodes;
using SpanFlow.Expressions;

var context = new ExpressionContext
{
    Input = JsonNode.Parse("""{ "order": { "id": 42, "total": 120.5, "items": [1, 2, 3] } }"""),
};

ExpressionEvaluator.EvaluateAsBool("input.order.total > 100 && input.order.items.length == 3", context); // true

// A template that is one whole {{ }} keeps its JSON type; mixed text becomes a string.
TemplateRenderer.RenderString("{{ input.order.id }}", context);         // 42 (a number)
TemplateRenderer.RenderString("Order #{{ input.order.id }}", context); // "Order #42"

// Render every {{ }} inside a JSON document.
var body = TemplateRenderer.Render(
    JsonNode.Parse("""{ "ref": "{{ input.order.id }}", "big": "{{ input.order.total > 100 }}" }"""), context);
Syntax Meaning
input.items[0].id A path. A missing path is null, never an error.
== != < <= > >= Comparisons (numbers compare as numbers).
&& \|\| ! ( ) Boolean logic. false, null, 0, "" and [] count as false.
x.length Length of a string or array.
exists(path) True when the path has a value (a missing path or a null is false).

The roots a context can expose are input, trigger, nodes.<id>.output, params, state, vars, user, headers and body.

Targets .NET 8, 9 and 10. MIT licensed.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on SpanFlow.Expressions:

Package Downloads
SpanFlow.Connectors.Http

Builds HTTP requests the way an API tool does (query, headers, JSON, form, multipart, raw bodies) and signs them: API key, basic, bearer, OAuth 2 client credentials, token endpoints, login requests, Digest, Hawk, OAuth 1 and JWT bearer. Includes a per-host request throttle.

SpanFlow.Connectors.Database

One adapter interface over PostgreSQL, SQL Server, MySQL/MariaDB and SQLite: open connections, list tables and columns, run parameterized queries, write and upsert rows. Includes a query advisor that flags risky SQL before it runs.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 107 11/9/2026