@camunda8/sdk
    Preparing search index...

    Interface ZBWorkerConfig<WorkerInputVariables, CustomHeaderShape, WorkerOutputVariables>

    interface ZBWorkerConfig<
        WorkerInputVariables,
        CustomHeaderShape,
        WorkerOutputVariables,
    > {
        CAMUNDA_JOB_WORKER_MAX_BACKOFF_MS?: number;
        connectionTolerance?: MaybeTimeDuration;
        customHeadersDto?: new (...args: any[]) => Readonly<CustomHeaderShape>;
        debug?: boolean;
        failProcessOnException?: boolean;
        fetchVariable?: (keyof WorkerInputVariables)[];
        id?: string;
        inputVariableDto?: new (...args: any[]) => Readonly<WorkerInputVariables>;
        loglevel?: Loglevel;
        logNamespace?: string;
        longPoll?: MaybeTimeDuration;
        maxJobsToActivate?: number;
        onConnectionError?: () => void;
        onConnectionErrorHandler?: ConnectionErrorHandler;
        onReady?: () => void;
        pollInterval?: MaybeTimeDuration;
        stdout?: ZBCustomLogger;
        taskHandler: ZBWorkerTaskHandler<
            WorkerInputVariables,
            CustomHeaderShape,
            WorkerOutputVariables,
        >;
        taskType: string;
        tenantIds?: string[];
        timeout?: MaybeTimeDuration;
    }

    Type Parameters

    • WorkerInputVariables
    • CustomHeaderShape
    • WorkerOutputVariables

    Hierarchy (View Summary)

    Index

    Properties

    CAMUNDA_JOB_WORKER_MAX_BACKOFF_MS?: number

    Maximum backoff time in milliseconds

    connectionTolerance?: MaybeTimeDuration

    If your Grpc connection jitters, this is the window before the connectionError

    customHeadersDto?: new (...args: any[]) => Readonly<CustomHeaderShape>

    Provide an annotated Dto class to control the serialisation of JSON numbers. This allows you to serialise numbers as strings or BigInts to avoid precision loss. This also gives you design-time type safety.

    debug?: boolean

    Enable debug tracking

    failProcessOnException?: boolean

    If a handler throws an unhandled exception, if this is set true, the process will be failed. Defaults to false.

    fetchVariable?: (keyof WorkerInputVariables)[]

    Constrain payload to these keys only.

    id?: string

    A custom id for the worker. If none is supplied, a UUID will be generated.

    inputVariableDto?: new (...args: any[]) => Readonly<WorkerInputVariables>

    Provide an annotated Dto class to control the serialisation of JSON numbers. This allows you to serialise numbers as strings or BigInts to avoid precision loss. This also gives you design-time type safety.

    loglevel?: Loglevel

    A log level if you want it to differ from the ZBClient

    logNamespace?: string
    longPoll?: MaybeTimeDuration

    A custom longpoll timeout. By default long polling is every 30 seconds.

    maxJobsToActivate?: number

    Max concurrent tasks for this worker. Default 32.

    onConnectionError?: () => void

    This handler is called when the worker cannot connect to the broker, or loses its connection.

    onConnectionErrorHandler?: ConnectionErrorHandler

    This handler is called when the worker cannot connect to the broker, or loses its connection.

    onReady?: () => void

    This handler is called when the worker (re)establishes its connection to the broker

    pollInterval?: MaybeTimeDuration

    Poll Interval in ms. Default 100.

    An implementation of the ZBCustomLogger interface for logging

    A job handler - this must return a job action - e.g.: job.complete(), job.error() - in all code paths.

    taskType: string

    The task type that this worker will request jobs for.

    tenantIds?: string[]

    An optional array of tenantIds if you want this to be a multi-tenant worker.

    timeout?: MaybeTimeDuration

    Max seconds to allow before time out of a job given to this worker. Default: 30s. The broker checks deadline timeouts every 30 seconds, so an