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",
      400

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Open the automation in the builder and ensure a trigger (e.g. Email trigger) is attached, then re-save
  2. Inspect the automation document and fix/repair the definition.trigger field
  3. 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

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


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