Budibase/budibase · error · HTTPError
No trigger found for automation
Error message
No trigger found for automation
What it means
The resolved automation has no trigger defined in automation.definition.trigger. Hydrating a saved IMAP password requires reading the email trigger's stored inputs, so the request is rejected with HTTP 400.
Source
Thrown at packages/server/src/api/controllers/automation.ts:249
}
if (!automationId) {
throw new HTTPError(
"Automation ID is required to test a saved password",
400
)
}
const automation = await context
.getWorkspaceDB()
.tryGet<Automation>(automationId)
if (!automation) {
throw new HTTPError("Automation not found", 404)
}
const trigger = automation.definition.trigger
if (!trigger) {
throw new HTTPError("No trigger found for automation", 400)
}
if (!isEmailTrigger(trigger)) {
throw new HTTPError("Automation trigger is not an email trigger", 400)
}
if (!trigger.inputs.password) {
throw new HTTPError("IMAP password is required", 400)
}
const stored = trigger.inputs
const connectionMatches =
emailInputs.host === stored.host &&
emailInputs.port === stored.port &&
emailInputs.username === stored.username &&
emailInputs.secure === stored.secure
if (!connectionMatches) {
throw new HTTPError(
"IMAP password is required when connection details change",
400View on GitHub (pinned to a81a902e9a)
Solutions
- Open the automation in the builder and ensure a trigger (e.g. Email trigger) is attached, then re-save
- Inspect the automation document and fix/repair the definition.trigger field
- Test with a different, correctly configured email automation
Defensive patterns
Strategy: validation
Validate before calling
if (!automation.definition?.trigger) throw new Error('Automation has no trigger; cannot test email connection') Type guard
function hasTrigger(a: Automation): a is Automation & { definition: { trigger: NonNullable<Automation['definition']['trigger']> } } {
return a.definition?.trigger != null
} Try / catch
try {
await testEmailConnection({ emailInputs, automationId })
} catch (e) {
if (e.status === 400 && e.message.includes('No trigger found')) {
// repair the automation definition before testing
}
} Prevention
- Validate automation definitions (trigger present) before saving or importing them
- Re-save automations through the builder rather than hand-editing documents
- Check for definition-shape changes after version upgrades
When it happens
Trigger: testEmailConnection on an automation whose definition lacks a trigger — e.g. an automation saved with only actions, a corrupt definition, or a manually crafted automation document.
Common situations: Automations created/edited via API or import with an incomplete definition; definitions produced by older versions before the trigger field shape stabilized.
Understand the failure class
Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.
Related errors
- Invalid automation CRON "${cronExp}" - ${validation.err.join
- Automation ID is required to test a saved password
- Automation trigger is not an email trigger
- IMAP password is required when connection details change
- Attachments must have both "url" and "filename" keys. You ha
AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29).
Data as JSON: /api/errors/2e46ef5e86cd3b71.
Report an issue: GitHub.