# Instrumented executor

Example custom executor that wraps node execution with timing instrumentation.

Canonical URL: https://opennodeflow.dev/wiki/reference-app-core-executor-instrumented/
JSON reference: https://opennodeflow.dev/wiki/reference-app-core-executor-instrumented/index.json
Source snapshot: 2026-10-23

# Instrumented executor

A sample execution wrapper that logs start and elapsed time around a node/trigger body. It preserves the original inputs, configuration, context, return value and error behavior.

## Wrapper contract
Records Date.now(), writes Executor started, awaits `execute(code, inputs, config, context)`, then writes Executor completed in <milliseconds>ms in a finally block. It declares no sockets or configuration schema. Timing includes execution/transpilation performed inside the helper; it is wall-clock duration, not CPU time.

## Example
The demo Read device payload definition selects this executor. To instrument a custom asset, select Instrumented executor while editing that node/trigger and publish. The dependency's version is pinned in that publication; updating this wrapper alone does not silently change existing definitions or graphs.

## Failures and interpretation
The finally log normally appears for both successful and thrown body results; it does not swallow or convert the error. A timeout, cancellation or hard process exit can terminate the worker before finally executes, so absence of a completion log does not prove the node never started. Engine retries re-run the wrapper and can produce several start/completion pairs. Body outputs/routes still undergo the normal engine validation afterward.

This wrapper adds only fixed/timing diagnostics, with no secret reads, network requests or durable-state changes. The wrapped body still has the ordinary trusted host permissions and may perform effects. It introduces no stronger sandbox, alternate operating-system runtime or exactly-once guarantee. A test-bench executor sample verifies wrapper behavior without workflow retries, downstream routing or persistent state.

## Catalog identity

| Field | Value |
| --- | --- |
| Source key | `app.core.executor.instrumented` |
| Kind | executor |
| Family | app-core |
| Pack | See library discovery |

[Integration guide](/wiki/first-workflow/) · [Browse the catalog](/wiki/integration-catalog/)



## Configuration schema


```json
{}
```





## Source and installed versions

This reference describes the maintained source catalog snapshot, not a live export of your installation. Published definitions use immutable versions; installed graphs retain their exact pins. Discover and read the installed definition and selected version before wiring it. See [versioning](/wiki/versioning/), [connections](/wiki/connections/) and [integration setup](/wiki/integration-setup/).

---

## Documentation provenance

- `../OpenNodeFlow-Library/work/catalog-all.mjs`
- `../OpenNodeFlow-Library/work/azure-pack-consolidation-20261022/catalog-policy.mjs`
- `../OpenNodeFlow-Library/work/developer-packs-20261022/catalog.mjs`
- `shared/seed.ts`
- `shared/storage-library.ts`
- `shared/variable-library.ts`
- `shared/control-flow.ts`
- `shared/remote-routes.ts`
- `server/runtime-library.ts`
- `shared/error-library.ts`
- `shared/storage-model.ts`
- `shared/builtin-documentation.ts`

This page describes maintained source, not a live inventory or an authorization to perform actions.
