{"record":{"id":"9d91602133bcb948","repo":"Budibase/budibase","slug":"cannot-create-an-operation-escalation-with-no-reci","errorCode":null,"errorMessage":"Cannot create an operation escalation with no recipients","messagePattern":"Cannot create an operation escalation with no recipients","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/server/src/escalation/processors/bull.ts","lineNumber":36,"sourceCode":"} from \".\"\n\nconst getDocId = (escalationId: string) =>\n  `${DocumentType.ESCALATION_CONTEXT}${SEPARATOR}${escalationId}`\n\nconst getNotifyJobId = (escalationId: string) => `esc_${escalationId}_notify`\nconst getResumeJobId = (escalationId: string) => `esc_${escalationId}_resume`\n\nconst buildEscalationId = () => `esc_${utils.newid()}`\n\nexport class BullEscalationProcessor implements IEscalationProcessor {\n  async create(input: CreateEscalationInput): Promise<CreateEscalationResult> {\n    const db = context.getWorkspaceDB()\n\n    if (\n      input.source === EscalationSource.OPERATION &&\n      !input.recipients?.length\n    ) {\n      throw new Error(\n        \"Cannot create an operation escalation with no recipients\"\n      )\n    }\n\n    const escalationId = input.escalationId ?? buildEscalationId()\n    const docId = getDocId(escalationId)\n    const now = new Date().toISOString()\n    const isTest =\n      input.source === EscalationSource.AUTOMATION\n        ? await checkTestFlag(input.automationId)\n        : false\n\n    const contextCompressed = zlib\n      .deflateSync(JSON.stringify(input.context))\n      .toString(\"base64\")\n\n    const existing = await db.tryGet<EscalationContextDoc>(docId)\n","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/escalation/processors/bull.ts#L18-L54","documentation":"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.","triggerScenarios":"Calling BullEscalationProcessor.create (directly or via the escalation API) with input.source = EscalationSource.OPERATION and recipients undefined, null, or an empty array.","commonSituations":"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.","solutions":["Compute and pass a non-empty recipients array (user/channel references) when creating an OPERATION escalation.","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.","Validate the recipient list upstream (fail fast at config-save time) so operations never attempt to escalate without targets."],"exampleFix":"// before\nawait processor.create({ source: EscalationSource.OPERATION, recipients: [], ... })\n// after\nif (!recipients.length) return skipEscalation()\nawait processor.create({ source: EscalationSource.OPERATION, recipients, ... })","handlingStrategy":"validation","validationCode":"if (input.source === EscalationSource.OPERATION && (!input.recipients || input.recipients.length === 0)) {\n  throw new Error(\"OPERATION escalations require at least one recipient\")\n}","typeGuard":null,"tryCatchPattern":"try {\n  await processor.create(input)\n} catch (err) {\n  if (err.message.includes(\"no recipients\")) {\n    // skip escalation or surface a config error to the operation author\n  } else throw err\n}","preventionTips":["Resolve and check recipients before attempting an operation escalation","Validate recipient configuration when saving the operation/agent config","Skip escalation creation gracefully when the recipient list resolves to empty"],"tags":["validation","escalation","precondition"],"backgroundTag":"missing-required-recipients","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}