WorkerConfig: {
    activities?: Record<string, Function>;
    connection: Connection;
    guid?: string;
    namespace?: string;
    options?: WorkerOptions;
    search?: WorkflowSearchOptions;
    taskQueue: string;
    workerCredentials?: {
        password: string;
        user: string;
    };
    workflow: Function | Record<string | symbol, Function>;
}

Type declaration

  • Optionalactivities?: Record<string, Function>

    Optional activity functions to register with this worker's task queue. When provided, these activities are registered and served on {taskQueue}-activity. Workflows can then call them via proxyActivities() without passing activities inline.

    Workflows can then call them via proxyActivities() without passing activities inline.

  • connection: Connection

    Connection configuration for the worker

  • Optionalguid?: string

    Provide to set the engine name. This MUST be unique, so do not provide unless it is guaranteed to be a unique engine/worker guid when identifying the point of presence within the mesh.

  • Optionalnamespace?: string

    Namespace used in the app configuration, denoted as appid in the YAML

    durable
    
  • Optionaloptions?: WorkerOptions

    Additional options for configuring the worker

  • Optionalsearch?: WorkflowSearchOptions

    Search options for workflow execution details

  • taskQueue: string

    Task queue name, denoted as subscribes in the YAML (e.g., 'hello-world')

  • OptionalworkerCredentials?: {
        password: string;
        user: string;
    }

    Scoped Postgres credentials for database-level worker isolation. When provided, the worker connects as a restricted Postgres role that can only dequeue/ack/respond on its allowed stream names via SECURITY DEFINER stored procedures.

    Provision credentials via HotMesh.provisionWorkerRole() (or the convenience alias Durable.provisionWorkerRole()).

    • password: string
    • user: string
  • workflow: Function | Record<string | symbol, Function>

    Target function or a record type with a name (string) and reference function