Interface: EffectWorkerConfig<A, R>
The Effect API is an opt-in subpath (@camunda8/orchestration-cluster-api/effect) and requires the optional effect peer dependency. The main . entry stays Promise-based and pulls in zero Effect at runtime.
Extends
Type Parameters
A
A extends CompleteVars
R
R = never
Properties
activationRetrySchedule?
readonly optional activationRetrySchedule?: Schedule<unknown, DomainError, never, R>;
Schedule used to back off and retry a failed activation request (transport
outage, broker restart, transient server error). Runs on the Effect Clock.
When omitted, an activation failure fails the stream.
Inherited from
ActivateJobsStreamOptions.activationRetrySchedule
concurrency?
readonly optional concurrency?: number | "unbounded";
Max jobs processed concurrently (handler parallelism / backpressure). The
activation loop will not pull faster than handlers drain, and the activation
batch is capped to this value (when it is a finite number) so the worker never
leases more jobs than it can process at once. Default: the value of
ActivateJobsStreamOptions.maxJobsToActivate (or 10).
fetchVariables?
readonly optional fetchVariables?: readonly string[];
Restrict activation to these variable names.
Inherited from
ActivateJobsStreamOptions.fetchVariables
handler
readonly handler: JobHandler<A, R>;
The Effect job handler.
handlerRetrySchedule?
readonly optional handlerRetrySchedule?: Schedule<unknown, JobError, never, R>;
Schedule used to retry the handler in-process on a RetryableJobError
before the job is failed back to the broker. Runs on the Effect Clock
(virtual under TestClock). A TerminalJobError is never retried.
jobTimeout?
readonly optional jobTimeout?: Input;
Per-job activation lock timeout (server-side). Default 60 seconds.
Inherited from
ActivateJobsStreamOptions.jobTimeout
maxJobsToActivate?
readonly optional maxJobsToActivate?: number;
Max jobs to activate per poll (the activation batch size). Default 10.
Inherited from
ActivateJobsStreamOptions.maxJobsToActivate
pollInterval?
readonly optional pollInterval?: Input;
Delay between polls that returned no jobs, on the Effect Clock (so it is
virtual under TestClock). A poll that returns jobs schedules the next poll
immediately. Default 1 second.
Inherited from
ActivateJobsStreamOptions.pollInterval
requestTimeout?
readonly optional requestTimeout?: Input;
Long-poll request timeout. 0 (the default) lets the broker hold the request
for its configured default; a negative value returns immediately when idle.
Inherited from
ActivateJobsStreamOptions.requestTimeout
type
readonly type: string;
The job type to activate.
withLease?
readonly optional withLease?: boolean;
Activate jobs with a lease — default false.
When true, each activated job is assigned a distinct, opaque lease token
(ActivatedJobResult.jobLeaseToken) that is threaded back into the fenced
completeJob / failJob / throwJobError commands, fencing them against a
superseded activation of the same job.
Note: the Effect handler intentionally keeps the base job shape
(jobLeaseToken remains optional/nullable); the token is threaded back into
fenced commands automatically, so handlers do not read it directly.
Inherited from
ActivateJobsStreamOptions.withLease
workerName?
readonly optional workerName?: string;
Worker name recorded on the activation request. Defaults to effect-worker-<type>-<n>, where <n> is an incrementing per-process counter.