Budibase/budibase · error

Escalation ${escalationId} not found

Error message

Escalation ${escalationId} not found

What it means

Thrown by the escalation respond flow when no context document exists for the given escalationId. The resolver looks up the escalation's context doc in the workspace DB before applying a response; if it is missing, the escalation either never existed, was deleted, or the ID is wrong, and the response cannot be recorded.

Source

Thrown at packages/server/src/sdk/workspace/escalations.ts:163

        doc != null && doc.escalationId === escalationId
    )
}

// Handles an incoming response from a recipient - writes the notification doc,
// runs the resolution strategy, and triggers resolve if the strategy returns truthy.
// NOTE: as notification channels grow, a dedicated notification processor may be
// a better home for this responsibility than the escalation processor.
export async function respond(
  escalationId: string,
  notificationDocId: string,
  response: EscalationResponse,
  resolve: (escalationId: string, response: EscalationResponse) => Promise<void>
): Promise<EscalationRespondResult> {
  const db = context.getWorkspaceDB()

  const contextDoc = await getContextDoc(escalationId)
  if (!contextDoc) {
    throw new Error(`Escalation ${escalationId} not found`)
  }
  if (contextDoc.resolution !== "pending") {
    return { status: "closed" }
  }

  const notifDoc = await db.tryGet<EscalationNotificationDoc>(notificationDocId)
  if (!notifDoc) {
    throw new Error(`Notification doc ${notificationDocId} not found`)
  }
  // Ensure the notification actually belongs to this escalation - stops a forged
  // payload pairing a valid notificationDocId with a different escalationId.
  if (notifDoc.escalationId !== escalationId) {
    console.warn(
      "Escalation respond: notification does not belong to escalation (possible forged payload)",
      {
        escalationId,
        notificationDocId,
        notifEscalationId: notifDoc.escalationId,

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Check the escalationId value and confirm the escalation exists via get/fetch before responding
  2. Ensure the call runs inside the correct workspace/tenant context so context.getWorkspaceDB() points at the DB holding the escalation doc
  3. If the escalation was legitimately removed, discard the stale response instead of retrying

Example fix

// before
await escalations.respond(staleIdFromOldNotification, response, resolve)
// after
const ctx = await getContextDoc(staleIdFromOldNotification)
if (ctx) await escalations.respond(staleIdFromOldNotification, response, resolve)
Defensive patterns

Strategy: try-catch

Validate before calling

const db = context.getWorkspaceDB()
const exists = !!(await db.tryGet<EscalationContextDoc>(escalationDocId(escalationId)))
if (!exists) throw new Error(`Escalation ${escalationId} does not exist`)

Try / catch

try {
  await escalations.respond(escalationId, response, resolve)
} catch (err) {
  if (err.message.includes("not found")) {
    // stale or unknown escalation — drop the response rather than retry
    return { status: "discarded" }
  }
  throw err
}

Prevention

When it happens

Trigger: Calling respond(escalationId, response, resolve) with an escalationId that has no corresponding context doc in the current workspace database — wrong ID, wrong workspace/tenant context, or the escalation docs were purged.

Common situations: Stale notification payloads replayed after the escalation was cleaned up; cross-tenant calls where the escalation lives in a different workspace DB; typos or truncated IDs from log scraping.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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