Budibase/budibase · error · Error
Email trigger inputs are required
Error message
Email trigger inputs are required
What it means
checkMail drives the IMAP email trigger polling. It requires the trigger's imapInputs (server, port, credentials, mailbox etc.); if the inputs object is falsy, an Error is thrown before any IMAP connection is attempted.
Source
Thrown at packages/server/src/automations/email/index.ts:33
const mailbox = imapInputs.mailbox || DEFAULT_MAILBOX
try {
imapClient = await getClient(imapInputs)
await imapClient.connect()
await imapClient.mailboxOpen(mailbox)
} finally {
if (imapClient) {
await imapClient.logout().catch(console.warn)
}
}
}
export const checkMail = async (
automationId: string,
imapInputs: EmailTriggerInputs
): Promise<CheckMailOutput> => {
if (!imapInputs) {
throw new Error("Email trigger inputs are required")
}
let imapClient: Awaited<ReturnType<typeof getClient>> | null = null
const mailbox = imapInputs.mailbox || DEFAULT_MAILBOX
const stateKey = automationId
try {
imapClient = await getClient(imapInputs)
const lastSeenUid = await getLastSeenUid(stateKey, mailbox)
const messages = await fetchMessages(imapClient, mailbox, lastSeenUid)
console.info(
`[email trigger] fetched ${messages.length} messages from mailbox ${mailbox}`
)
if (!messages.length) {
return { proceed: false, reason: "no new mail" }
}
View on GitHub (pinned to a81a902e9a)
Solutions
- Edit the email trigger in the automation and complete the IMAP configuration (host, port, username, password, mailbox).
- Re-save the trigger so inputs are persisted to the automation definition.
- Re-create the email trigger if its inputs are missing from the stored definition.
- Verify the automation definition doc contains non-empty trigger.inputs.
Example fix
// before
trigger: { type: EMAIL, inputs: undefined }
// after
trigger: { type: EMAIL, inputs: { host: "imap.example.com", port: 993, username: "user@example.com", password: "pass", mailbox: "INBOX" } } Defensive patterns
Strategy: validation
Validate before calling
const inputs = automation.definition.trigger.inputs as EmailTriggerInputs | undefined
if (!inputs || !inputs.host || !inputs.port) {
throw new Error("Email trigger IMAP inputs missing; configure host/port/auth before running")
} Type guard
const hasImapInputs = (i?: EmailTriggerInputs | null): i is EmailTriggerInputs => Boolean(i && i.host && i.port)
Try / catch
try {
await checkMail(automationId, imapInputs)
} catch (e) {
if (e.message === "Email trigger inputs are required") {
// prompt user to complete IMAP configuration in the builder
} else throw e
} Prevention
- Complete all IMAP fields when creating the email trigger.
- Re-check trigger inputs after importing/exporting apps.
- Validate the automation definition's trigger.inputs before manual runs.
- Version-check old triggers after upgrades that change input shapes.
When it happens
Trigger: An email trigger automation is executed with no inputs configured — e.g. the trigger definition lacks the IMAP configuration block, or inputs were lost/not passed during a manual trigger or import.
Common situations: Importing an app where the email trigger inputs were not exported; creating the trigger without completing IMAP setup (host/port/auth); older app versions with a different input shape.
Related errors
- Automation ID is required to test a saved password
- Automation trigger is not an email trigger
- IMAP password is required
- IMAP password is required when connection details change
- Unable to find action implementation for "${stepId}"
AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29).
Data as JSON: /api/errors/e4c7c4b46dfe4238.
Report an issue: GitHub.