nestjs-temporal-core
    Preparing search index...

    Interface WorkerCreateOptions

    Advanced configuration options for Temporal Worker creation. Controls worker behavior, concurrency, and performance settings. This interface includes all options from Temporal SDK's WorkerOptions except for connection, taskQueue, activities, workflowsPath, and workflowBundle which are managed by the framework.

    For complete documentation of each option, see: https://typescript.temporal.io/api/interfaces/worker.WorkerOptions

    const workerOptions: WorkerCreateOptions = {
    maxConcurrentActivityTaskExecutions: 100,
    maxConcurrentWorkflowTaskExecutions: 50,
    maxActivitiesPerSecond: 200,
    shutdownGraceTime: '30s',
    shutdownForceTime: '60s',
    enableLoggingInReplay: false,
    identity: 'production-worker-1'
    };
    interface WorkerCreateOptions {
        buildId?: string;
        bundlerOptions?: Record<string, unknown>;
        dataConverter?: Record<string, unknown>;
        debugMode?: boolean;
        defaultHeartbeatThrottleInterval?: string | number;
        enableLoggingInReplay?: boolean;
        enableNonLocalActivities?: boolean;
        enableOpenTelemetry?: boolean;
        enableSDKTracing?: boolean;
        identity?: string;
        interceptors?: {
            activity?: unknown[];
            activityInbound?: unknown[];
            workflowModules?: string[];
        };
        maxActivitiesPerSecond?: number;
        maxCachedWorkflows?: number;
        maxConcurrentActivityTaskExecutions?: number;
        maxConcurrentActivityTaskPolls?: number;
        maxConcurrentLocalActivityExecutions?: number;
        maxConcurrentWorkflowTaskExecutions?: number;
        maxConcurrentWorkflowTaskPolls?: number;
        maxHeartbeatThrottleInterval?: string
        | number;
        maxTaskQueueActivitiesPerSecond?: number;
        nonStickyToStickyPollRatio?: number;
        reuseV8Context?: boolean;
        showStackTraceSources?: boolean;
        shutdownForceTime?: string | number;
        shutdownGraceTime?: string | number;
        sinks?: Record<string, unknown>;
        stickyQueueScheduleToStartTimeout?: string | number;
        tuner?: Record<string, unknown>;
        useVersioning?: boolean;
        workerDeploymentOptions?: Record<string, unknown>;
        workflowThreadPoolSize?: number;
    }
    Index

    Properties

    buildId?: string

    A string that should be unique to the exact worker code/binary being executed.

    Use workerDeploymentOptions instead

    bundlerOptions?: Record<string, unknown>

    Options for the Webpack bundler when using workflowsPath.

    dataConverter?: Record<string, unknown>

    Provide a custom DataConverter.

    debugMode?: boolean

    Enable debug mode.

    defaultHeartbeatThrottleInterval?: string | number

    Default heartbeat throttle interval.

    number of milliseconds or ms-formatted string

    enableLoggingInReplay?: boolean

    Enable logging in replay.

    false
    
    enableNonLocalActivities?: boolean

    Whether or not to poll on the Activity task queue.

    true
    
    enableOpenTelemetry?: boolean

    Enable opentelemetry.

    enableSDKTracing?: boolean

    Enable SDK metrics.

    identity?: string

    A human-readable string that can identify your worker.

    ${process.pid}@${os.hostname()}

    interceptors?: {
        activity?: unknown[];
        activityInbound?: unknown[];
        workflowModules?: string[];
    }

    Activity interceptors.

    maxActivitiesPerSecond?: number

    Limits the number of Activities per second that this Worker will process.

    maxCachedWorkflows?: number

    Maximum number of cached workflows.

    600
    
    maxConcurrentActivityTaskExecutions?: number

    Maximum number of Activity tasks to execute concurrently. Mutually exclusive with tuner.

    100 if no tuner is set
    
    maxConcurrentActivityTaskPolls?: number

    Maximum number of concurrent Activity task polls.

    5
    
    maxConcurrentLocalActivityExecutions?: number

    Maximum number of Local Activity tasks to execute concurrently. Mutually exclusive with tuner.

    100 if no tuner is set
    
    maxConcurrentWorkflowTaskExecutions?: number

    Maximum number of Workflow Tasks to execute concurrently. Mutually exclusive with tuner.

    100 if no tuner is set
    
    maxConcurrentWorkflowTaskPolls?: number

    Maximum number of concurrent Workflow task polls.

    5
    
    maxHeartbeatThrottleInterval?: string | number

    Maximum heartbeat throttle interval.

    number of milliseconds or ms-formatted string

    maxTaskQueueActivitiesPerSecond?: number

    Sets the maximum number of activities per second the task queue will dispatch (server-side).

    nonStickyToStickyPollRatio?: number

    Ratio of non-sticky to sticky workflow task polls.

    reuseV8Context?: boolean

    Whether to reuse V8 context between workflow executions.

    false
    
    showStackTraceSources?: boolean

    Show stack trace sources in error messages.

    shutdownForceTime?: string | number

    Time to wait before giving up on graceful shutdown and forcefully terminating the worker.

    number of milliseconds or ms-formatted string

    shutdownGraceTime?: string | number

    Time to wait for pending tasks to drain after shutdown was requested.

    number of milliseconds or ms-formatted string

    0
    
    sinks?: Record<string, unknown>

    Custom sink function for workflow logs and metrics.

    stickyQueueScheduleToStartTimeout?: string | number

    Timeout for sticky queue schedule to start.

    number of milliseconds or ms-formatted string

    5s
    
    tuner?: Record<string, unknown>

    Provide a custom WorkerTuner. Mutually exclusive with maxConcurrentWorkflowTaskExecutions, maxConcurrentActivityTaskExecutions, and maxConcurrentLocalActivityExecutions.

    useVersioning?: boolean

    If set true, this worker opts into the worker versioning feature.

    Use workerDeploymentOptions instead

    workerDeploymentOptions?: Record<string, unknown>

    Deployment options for the worker.

    workflowThreadPoolSize?: number

    Number of threads for workflow execution.

    2