{
  "schemaVersion": 1,
  "snapshotDate": "2026-10-23",
  "slug": "reference-app-core-executor-instrumented",
  "title": "Instrumented executor",
  "section": "Library asset reference",
  "description": "Example custom executor that wraps node execution with timing instrumentation.",
  "kind": "executor",
  "url": "/wiki/reference-app-core-executor-instrumented/",
  "markdown": "/wiki/reference-app-core-executor-instrumented/index.md",
  "json": "/wiki/reference-app-core-executor-instrumented/index.json",
  "headings": [
    {
      "id": "wrapper-contract",
      "title": "Wrapper contract",
      "depth": 2
    },
    {
      "id": "example",
      "title": "Example",
      "depth": 2
    },
    {
      "id": "failures-and-interpretation",
      "title": "Failures and interpretation",
      "depth": 2
    },
    {
      "id": "catalog-identity",
      "title": "Catalog identity",
      "depth": 2
    },
    {
      "id": "configuration-schema",
      "title": "Configuration schema",
      "depth": 2
    },
    {
      "id": "source-and-installed-versions",
      "title": "Source and installed versions",
      "depth": 2
    }
  ],
  "sources": [
    "../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"
  ],
  "family": "app-core",
  "contract": {
    "key": "app.core.executor.instrumented",
    "slug": "app-core-executor-instrumented",
    "name": "Instrumented executor",
    "kind": "executor",
    "family": "app-core",
    "packId": null,
    "category": "Runtimes",
    "description": "Example custom executor that wraps node execution with timing instrumentation.",
    "inputs": [],
    "outputs": [],
    "configSchema": {},
    "documentation": "# Instrumented executor\n\nA 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.\n\n## Wrapper contract\nRecords 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.\n\n## Example\nThe 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.\n\n## Failures and interpretation\nThe 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.\n\nThis 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.",
    "tags": [
      "builtin",
      "executor"
    ],
    "source": "app-builtin-catalog"
  }
}
