Type Alias: ProcessDefinition {#type-alias-processdefinition}

ProcessDefinition = object

A complete process definition binding an event name to a handler with optional schema validation, retry policy, and version tracking.

Properties {#properties}

emits? {#emits}

optional emits: string[]

Event names this process may emit via triggerEvent. Declared explicitly via the emits registration option. Used by Engine.getGraph to build the static event flow graph.


eventName {#eventname}

eventName: string

The event name this process listens for.


handler {#handler}

handler: Handler

The handler function executed when the event fires.


name {#name}

name: string

Unique name identifying this process.


retry? {#retry}

optional retry: RetryPolicy

Optional retry policy for automatic retries on failure.


schema? {#schema}

optional schema: Schema

Optional schema to validate event payloads before execution.


singleton? {#singleton}

optional singleton: boolean

When true, only one run of this process may be active (idle or running) at a time.

Default Value {#singleton-default-value}

false

version? {#version}

optional version: string

Optional version string for handler versioning and migration.