Skip to content

What is Execution Engine? ​

Execution Engine records what your code did at runtime — inputs, outputs, errors and timing — without requiring you to rewrite function bodies. It runs in your process and returns plain data.

It has two independent modes: use Execution for one function, or Engine for a connected workflow.

Execution — individual functions ​

Observe or optimize individual functions without an engine. Use Trace for call data, Cache or Memoize to avoid repeated work, and Timer for elapsed time. Use retry or @retry to retry temporary failures with a bounded attempt count, backoff and cancellation. Retry can also record attempts when given an engine.

Engine — a whole run ​

Route related calls through an engine. Each call becomes a node; edges capture order, nesting and parallel work. The result is a portable JSON Trace of the whole run.

Graph data that travels

Engine traces use a Cytoscape-compatible shape.

  • Visualize — open a trace in the json-to-graph viewer.
  • Test — assert directly on its nodes and edges.
  • Resume — pass a stored trace back to an engine and continue the run.

Which one? ​

ExecutionEngine
ScopeOne functionMany calls, and their relationships
OutputThe function's value or a call record, depending on the APIA JSON graph of nodes and edges
SetupNothingAn engine instance
Order, nesting, parallelismNot trackedTracked
Use it forLogging, metrics, caching, deduplication, retriesPipelines, workflows, orchestration

The two are independent; use either without adopting the other.

Released under the MIT License.