Budibase/budibase · error · HTTPError

Automation not found

Error message

Automation not found

What it means

When a webhook of type AUTOMATION has its body schema updated, the controller loads the target automation document from the workspace DB using tryGet (which returns null instead of throwing). If no automation document matches webhook.action.target, a 404 HTTPError is thrown.

Source

Thrown at packages/server/src/api/controllers/webhook.ts:84

const assertSchemaWorkspace = (instance: string) => {
  if (dbCore.isDevWorkspaceID(instance)) {
    return
  }

  throw new HTTPError("Webhook schema can only be built in development", 400)
}

const updateWebhookSchema = async (
  body: BuildWebhookSchemaRequest,
  webhook: Webhook,
  db: ReturnType<typeof context.getWorkspaceDB>
) => {
  webhook.bodySchema = toJsonSchema(body)
  if (webhook.action.type === WebhookActionType.AUTOMATION) {
    const automation = await db.tryGet<Automation>(webhook.action.target)
    if (!automation) {
      throw new HTTPError("Automation not found", 404)
    }
    const autoOutputs = automation.definition.trigger.schema.outputs
    const properties = webhook.bodySchema?.properties
    autoOutputs.properties = {
      body: autoOutputs.properties.body,
    }
    for (let prop of Object.keys(properties || {})) {
      if (properties?.[prop] == null) {
        continue
      }
      const def = properties[prop]
      if (typeof def === "boolean") {
        continue
      }
      autoOutputs.properties[prop] = {
        type: def.type as AutomationIOType,
        description: AUTOMATION_DESCRIPTION,
      }

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Recreate the webhook pointing at an existing automation (or delete the stale webhook).
  2. Verify webhook.action.target matches an existing automation _id in the workspace DB (Fauxton/direct DB check).
  3. Re-sync the webhook by re-saving the automation trigger so the webhook doc is regenerated.
  4. Restore the deleted automation from a backup if it is still needed.

Example fix

// before
webhook.action.target = "auto_deleted123"
// after
webhook.action.target = existingAutomation._id
Defensive patterns

Strategy: try-catch

Validate before calling

const db = context.getWorkspaceDB()
const automation = await db.tryGet<Automation>(webhook.action.target)
if (!automation) throw new Error(`Automation ${webhook.action.target} missing; fix webhook before schema build`)

Type guard

const hasAutomation = async (db: any, id: string) =>
  Boolean(await db.tryGet<Automation>(id))

Try / catch

try {
  await buildWebhookSchema(appId, webhookId)
} catch (e) {
  if (e.status === 404 && e.message === "Automation not found") {
    // delete/recreate the webhook or rebind webhook.action.target
  } else throw e
}

Prevention

When it happens

Trigger: Webhook action target points to an automation ID that no longer exists in the workspace DB (automation deleted, webhook copied across apps, wrong target stored in the webhook doc).

Common situations: Deleting an automation without removing its webhook; exporting/importing an app where the webhook doc references an automation from another app; manually editing webhook docs in CouchDB.

Related errors


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