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
- Recreate the webhook pointing at an existing automation (or delete the stale webhook).
- Verify webhook.action.target matches an existing automation _id in the workspace DB (Fauxton/direct DB check).
- Re-sync the webhook by re-saving the automation trigger so the webhook doc is regenerated.
- 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
- Delete webhooks when deleting their automations.
- Never copy webhook docs between apps; recreate them.
- After imports, verify webhook action targets resolve to existing automations.
- Use the builder UI to manage webhooks so bindings stay consistent.
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
- Webhook not found
- Operation not found for this agent
- Custom REST template not found
- Resource not found: ${body.resourceId}
- Automation is disabled
AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29).
Data as JSON: /api/errors/5ed31ce91ff0cbd7.
Report an issue: GitHub.