Budibase/budibase · error · Error

Cannot create an operation escalation with no recipients

Error message

Cannot create an operation escalation with no recipients

What it means

The Bull-based escalation processor requires OPERATION-source escalations to name their notification recipients up front, since unlike automation escalations there is no interactive card/user to derive them from. If create() is called with source OPERATION and an empty/missing recipients array, it throws immediately before writing the context doc or enqueuing the notify job.

Source

Thrown at packages/server/src/escalation/processors/bull.ts:36

} from "."

const getDocId = (escalationId: string) =>
  `${DocumentType.ESCALATION_CONTEXT}${SEPARATOR}${escalationId}`

const getNotifyJobId = (escalationId: string) => `esc_${escalationId}_notify`
const getResumeJobId = (escalationId: string) => `esc_${escalationId}_resume`

const buildEscalationId = () => `esc_${utils.newid()}`

export class BullEscalationProcessor implements IEscalationProcessor {
  async create(input: CreateEscalationInput): Promise<CreateEscalationResult> {
    const db = context.getWorkspaceDB()

    if (
      input.source === EscalationSource.OPERATION &&
      !input.recipients?.length
    ) {
      throw new Error(
        "Cannot create an operation escalation with no recipients"
      )
    }

    const escalationId = input.escalationId ?? buildEscalationId()
    const docId = getDocId(escalationId)
    const now = new Date().toISOString()
    const isTest =
      input.source === EscalationSource.AUTOMATION
        ? await checkTestFlag(input.automationId)
        : false

    const contextCompressed = zlib
      .deflateSync(JSON.stringify(input.context))
      .toString("base64")

    const existing = await db.tryGet<EscalationContextDoc>(docId)

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Compute and pass a non-empty recipients array (user/channel references) when creating an OPERATION escalation.
  2. If recipients are optional in your flow, either choose a different escalation source or handle the throw and skip escalation creation when the list is empty.
  3. Validate the recipient list upstream (fail fast at config-save time) so operations never attempt to escalate without targets.

Example fix

// before
await processor.create({ source: EscalationSource.OPERATION, recipients: [], ... })
// after
if (!recipients.length) return skipEscalation()
await processor.create({ source: EscalationSource.OPERATION, recipients, ... })
Defensive patterns

Strategy: validation

Validate before calling

if (input.source === EscalationSource.OPERATION && (!input.recipients || input.recipients.length === 0)) {
  throw new Error("OPERATION escalations require at least one recipient")
}

Try / catch

try {
  await processor.create(input)
} catch (err) {
  if (err.message.includes("no recipients")) {
    // skip escalation or surface a config error to the operation author
  } else throw err
}

Prevention

When it happens

Trigger: Calling BullEscalationProcessor.create (directly or via the escalation API) with input.source = EscalationSource.OPERATION and recipients undefined, null, or an empty array.

Common situations: An agent/operation config that resolves recipients dynamically returned nothing; a code path forgot to populate recipients for operation escalations; recipients were filtered out earlier (e.g. no Teams identity links) and the empty list was passed through.

Related errors


AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29). Data as JSON: /api/errors/9d91602133bcb948. Report an issue: GitHub.