interface ConditionQueueConfig {
    accumulate?: AccumulateConfig;
    assignee?: string;
    batch?: string[];
    description?: string;
    durationMinutes?: number;
    entity?: string;
    envelope?: Record<string, unknown>;
    expiresAt?: Date;
    filled?: Record<string, BatchFilledEntry<Record<string, unknown>>>;
    initiatedBy?: string;
    metadata?: Record<string, unknown>;
    originId?: string;
    parentId?: string;
    partialOnTimeout?: boolean;
    priority?: number;
    role?: string;
    spanId?: string;
    subtype?: string;
    taskQueue?: string;
    timeout?: string;
    traceId?: string;
    type?: string;
    wakeOnFill?: boolean | string[];
    wakeOnFlag?: boolean;
    workflowType?: string;
}

Properties

accumulate?: AccumulateConfig

Declares the wait as an open accumulator: items arrive over time via accumulateItem() and the collection is delivered on every terminal path except cancel. Resolves with { $accumulated, $trigger } when max items are held ($trigger: 'count'), when timeout fires ('timeout', status expired), or on a manual resolve() ('resolve', merged with the resolver payload). Folded at creation into metadata.accumulate_count / accumulate_max / accumulate_keys and envelope.accumulate_items / accumulate_config — one atomic INSERT with the workflow checkpoint. Mutually exclusive with batch.

assignee?: string

Born-assigned: writes assigned_to in the same atomic INSERT that creates the row — on the condition() path, one commit with the workflow's Leg1 checkpoint. Alone it is a durable pre-assignment: the row surfaces in the assignee's list({ assignedTo }) immediately, is resolvable by the assignee with assertClaim, and remains claimable by others (a routing hint). With durationMinutes it is a hard claim at creation. The created event payload carries the assignment.

batch?: string[]

Declares the wait as a batch accumulator: the escalation only resolves once every named item has been submitted via resolveBatchItem(). Each entry is an item key a contributor fills exactly once; the wait's signal fires with the full collection (Record<itemKey, payload>) when the LAST item lands. Folded at creation into the row's queryable facets (metadata.batch_pending / batch_count / batch_keys) and payload accumulator (envelope.batch_items) — one atomic INSERT with the workflow checkpoint. timeout and cancel() semantics are unchanged: false / null, with any partially filled items preserved on the terminal row for audit.

description?: string
durationMinutes?: number

With assignee, arms the claim TTL window (assigned_until / claim_expires_at) at creation — the row is born locked to the assignee, exactly as a post-create claim() locks it.

entity?: string
envelope?: Record<string, unknown>

Unindexed display/form context for resolver UIs

expiresAt?: Date
filled?: Record<string, BatchFilledEntry<Record<string, unknown>>>

With batch, entries already satisfied when the row is created (for example, received before the wait began). Each key must be declared in batch; at least one key must remain open. The entries are folded into the same creation INSERT: batch_pending / batch_count start without them, and batch_items / batch_filled_at / batch_filled_by hold their payload, time, and actor, so progress and completion count them and the completing signal delivers them with the rest. Pure input: at comes from the source of record, never a fresh clock in the workflow, so the replayed condition() folds the same row.

initiatedBy?: string
metadata?: Record<string, unknown>

GIN-indexed; put claim/filter keys here

originId?: string
parentId?: string
partialOnTimeout?: boolean

With batch, a timeout resumes the wait with the items filled so far plus $trigger: 'timeout' instead of false. Off by default, so existing batch waiters are unchanged.

priority?: number
role?: string
spanId?: string
subtype?: string
taskQueue?: string
timeout?: string

SLA timer for the wait itself (e.g. '30m', '24h'). Arms the same resume timer as condition(signalId, '30m'): when it fires first, the workflow resumes with false and the escalation row transitions pending → expired (a later resolve fails as already-expired). A signal that arrives first resolves normally and the timer is inert.

traceId?: string
type?: string
wakeOnFill?: boolean | string[]

With batch, a resolveBatchItem() fill ends the wait: the row resolves and the wait resumes with the items filled so far, the key that woke it ($filled: [itemKey]), $trigger: 'fill', each filled key's fill time ($filledAt) and recorded actor ($filledBy). true wakes on every fill; a list of declared keys wakes only when one of those keys fills. The last fill completes the wait as on any batch. Pair with filled to park the next round with the items carried forward: $filledAt and $filledBy supply each entry's at and actor. Off by default: a fill is then recorded on the row and the wait continues until the last key.

wakeOnFlag?: boolean

With batch, a flagBatchItem() call ends the wait: the row resolves and the wait resumes with the items filled so far, the flags ($flags), and $trigger: 'flag'. Off by default: a flag is then recorded on the row and the wait continues.

workflowType?: string