• Folds a batch declaration into the escalation's storage shape: queryable facets in metadata (batch_pending, batch_count, batch_keys) and the payload accumulator in envelope (batch_items: {}). partialOnTimeout is stored beside the items so the expiry statement delivers the filled items instead of false; wakeOnFlag is stored the same way so a flag ends the wait, and wakeOnFill (true or its list of keys) so a fill ends it. filled entries start satisfied: they are left out of batch_pending and written into batch_items, batch_filled_at, and (when an entry names an actor) batch_filled_by. Pure and deterministic — safe on the replayed condition() path. Throws synchronously on an invalid declaration so a bad batch never reaches a durable write.

    Type Parameters

    • T extends {
          accumulate?: AccumulateConfig;
          batch?: string[];
          envelope?: Record<string, unknown>;
          filled?: Record<string, BatchFilledEntry<Record<string, unknown>>>;
          metadata?: Record<string, unknown>;
          partialOnTimeout?: boolean;
          wakeOnFill?: boolean | string[];
          wakeOnFlag?: boolean;
      }

    Parameters

    • config: T

    Returns Omit<T,
        | "batch"
        | "partialOnTimeout"
        | "wakeOnFlag"
        | "wakeOnFill"
        | "filled">