On this page
SDK samples
Each sample demonstrates a different application integration using synthetic local data. Run the complete set from the Samples Runner, then inspect an individual project's source and change its input.

Start the samples
Install the .NET 11 SDK. From the repository root:
dotnet build .\samples\Benchius\Benchius.Samples.sln
dotnet run --project .\samples\Benchius\SamplesRunner\Benchius.Samples.Runner.csproj
Open http://127.0.0.1:5100/ and choose Start all samples. The runner owns its child processes, waits for responsive applications, and connects remote SDK clients to the local control plane. Stop all samples and runner shutdown stop those owned processes.
Every demonstration has editable request JSON, a concrete experiment to try, inspectable results, and a source link. The hosted Studio supplies its own graph and Preview input instead of the request form.
| Sample | Address | Differentiated value |
|---|---|---|
| Local HTTP and API discovery | http://127.0.0.1:5110/ |
Host the contract for any language; discover capabilities, validate a graph, evaluate expressions, and open the anonymous contract viewer |
| Support-ticket approval | http://127.0.0.1:5111/ |
Stream remote events, answer exact pending human input, route approval, and exercise idempotency |
| Offline purchase policy | http://127.0.0.1:5112/ |
Embed the runtime directly for batched calculations, nested conditions, and disconnected execution |
| Normalization comparison | http://127.0.0.1:5113/ |
Compare independently streamed workflows against an explicit expected output |
| Embeddable Workflow Studio | http://127.0.0.1:5114/studio |
Provide editor parameters and receive an edited document in the host's SDK runtime callback |
| Libraries and filtered vectors | http://127.0.0.1:5115/ |
Handle revisions, reload encrypted documents, and search a named embedding space with metadata filters |
The shared appSettings.config supplies the public demonstration API key. BENCHIUS_API_KEY overrides it, and BENCHIUS_ENDPOINT overrides connected clients. The runner passes a matching key to its local service and clients. Use a private workspace for real application data.
Local HTTP and API discovery
The LocalEndpoint project composes AddBenchiusControlPlane, the control-plane middleware, authentication, authorization, and route mapping. Its scenario makes separate discovery, graph-validation, and expression-evaluation calls.
{"text":" Ticket-204 "}
The normalized result is ticket-204. Open http://127.0.0.1:5110/openapi to inspect and exercise the real HTTP interfaces. Contracts load without a key; every operational route continues to require X-Benchius-Api-Key.
Use this sample when adapting a Python, JavaScript, or other non-.NET application to a privately hosted workflow service. The API reference includes the minimal host.
Support-ticket approval
{
"ticket": " Cannot sign in to the sample portal ",
"decision": "Approve"
}
The connected .NET application starts a workflow and relays its live sequenced events to the browser. At InputRequested, it reads the run's actual pending requests and submits the selected response with the exact request ID. Approve dispatches the ticket; Hold selects manual review. This is a synthetic review exercise with the response selected before execution.
Add "requestId":"ticket-204" to demonstrate idempotency. An unchanged request reuses the retained run. Changing its ticket text while retaining that request ID returns a conflict. The sample owns unfinished runs and explicitly cancels them when its streaming request is abandoned.
Offline purchase policy
{
"items": [
{"sku":"NOTEBOOK","quantity":3,"unitPrice":12.5},
{"sku":"MONITOR","quantity":1,"unitPrice":249}
]
}
The in-process engine runs a ForEach body for each line. It multiplies price by quantity, evaluates the $100 threshold, skips the unselected branch, and returns typed receipts.
The notebook total is 37.5 with decision Approved; the monitor total is 249 with decision Review. A line total of exactly 100 is approved. Change a price or quantity to cross the boundary and inspect the iteration and skipped-node events. The sample accepts up to 20 lines.
Use this pattern for embedded business rules, local batch processing, or disconnected workflows. No HTTP service or control-plane API key participates in this scenario.
Normalization comparison
{
"text": " Priority: Cannot sign in ",
"expected": "priority: cannot sign in"
}
The baseline trims whitespace and preserves case. The candidate trims and lowercases. Both receive the same input through the benchmark API, stream independently, and produce separate run snapshots. The sample scores each result using an ordinal exact match against the supplied expectation.
With the default input, the baseline misses and the canonical pipeline matches. Change the expected result or use already canonical text to see both matches. Durations come from actual host execution. All operations are deterministic local expressions; the sample provides an evaluation harness you can adapt to provider-backed workflows.
Embeddable Workflow Studio

The sample's Blazor root renders the Studio pane and required browser assets. Its router also includes model-configuration pages used by the Studio's internal frames.
The host provides a WorkflowComposerSession, the purchase-policy graph, Preview input, toolbar-visibility parameters, an application action label, and OnSave. Edit a step or its Preview input, then choose Run with SDK. The host receives a copied workflow document and executes it through Benchius.Runtime. Results appear inside the Studio's HostContent slot.
Set HostedDesigner:PreviewInput in host configuration to change the initial input. The embedding guide documents the component parameters and lifetime responsibilities.
This source sample uses the repository's WebFrontEnd content root and service setup. Its BenchiusDesignerHost=true project reference isolates frontend build/static-asset outputs. Provider-dependent custom workflows require the application's execution credentials and services; the sample callback initially configures the disconnected runtime.
Libraries and filtered vectors
{"category":"travel"}
The scenario creates an encrypted workflow document, updates its observed revision, intentionally attempts a stale save, and reloads the accepted version. It reports the actual 409 concurrency conflict.
It then upserts hand-authored three-dimensional vectors into a unique collection with the embedding-space identity synthetic-expenses-3d. Filtering occurs before top K. travel returns the hotel and rail-fare records; meals returns the meal record.
Each run deletes its own temporary document and collection after the demonstration. Independent runs use separate collection names, preserving unrelated application data. Use the SDK's library and data clients directly when your application intends to retain records.
Verify every scenario
dotnet run --project .\samples\Benchius\SamplesRunner\Benchius.Samples.Runner.csproj -- --verify
Build first because verification launches children with --no-build. The runner checks actual scenario outputs, approval events, threshold branches, comparison scores, revision conflicts, filtered matches, public contracts, protected operational routes, and the standalone Studio's framework bootstrap. It stops every process it starts.
All checked-in scenarios avoid provider calls. Authoring provider-dependent workflows can introduce their normal connectivity requirements and charges.