{"record":{"id":"d49c1e43d2053db7","repo":"Budibase/budibase","slug":"automation-is-disabled","errorCode":null,"errorMessage":"Automation is disabled","messagePattern":"Automation is disabled","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/server/src/automations/triggers.ts","lineNumber":216,"sourceCode":"}\n\nexport async function externalTrigger(\n  automation: Automation,\n  params: AutomationTriggerParams,\n  options: ExternalTriggerOptions & { getResponses: true }\n): Promise<AutomationResults | DidNotTriggerResponse>\nexport async function externalTrigger(\n  automation: Automation,\n  params: AutomationTriggerParams,\n  options?: ExternalTriggerOptions & { getResponses?: false }\n): Promise<AutomationJob | DidNotTriggerResponse>\nexport async function externalTrigger(\n  automation: Automation,\n  params: AutomationTriggerParams,\n  { getResponses, onProgress, isTestRun }: ExternalTriggerOptions = {}\n): Promise<AutomationResults | DidNotTriggerResponse | AutomationJob> {\n  if (automation.disabled) {\n    throw new Error(\"Automation is disabled\")\n  }\n\n  const workspaceId = params.appId || context.getWorkspaceId()\n  const isDevRun = workspaceId ? isDevWorkspaceID(workspaceId) : false\n  const shouldRunAsTest = Boolean(isTestRun || isDevRun)\n\n  if (\n    sdk.automations.isAppAction(automation) &&\n    !isTestRun &&\n    !(await checkTestFlag(automation._id!))\n  ) {\n    if (params.fields == null) {\n      params.fields = {}\n    }\n\n    // values are likely to be submitted as strings, so we shall convert to correct type\n    const coercedFields: any = {}\n    const triggerInputs = automation.definition.trigger.inputs || {}","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/automations/triggers.ts#L198-L234","documentation":"`externalTrigger` is the entry point for API/webhook-initiated automation runs. Before doing anything it checks `automation.disabled`; if the automation has been disabled in the builder (or programmatically), it refuses to run and throws 'Automation is disabled'. This prevents external callers from firing automations that an admin explicitly turned off.","triggerScenarios":"POSTing to the automation trigger/webhook endpoint (/automations/{id}/trigger or a webhook URL) for an automation whose `disabled` flag is true; hitting a webhook whose backing automation was disabled after the webhook was created.","commonSituations":"An admin disabled a misbehaving automation but an external system (Zapier, cron, another app) still calls its webhook URL; importing an app export where the automation was disabled at export time; test scripts replaying recorded triggers against a disabled automation.","solutions":["Re-enable the automation in the builder (toggle the automation's enabled/disabled state).","Check via the API that automation.disabled is false before calling the trigger endpoint.","Remove or update the external caller so it no longer invokes the disabled automation's webhook."],"exampleFix":"// before: curl -X POST https://app.budi.live/api/automations/<id>/trigger\n// after (in app code): if (automation.disabled) return; await api.post(`/automations/${id}/trigger`, params)","handlingStrategy":"try-catch","validationCode":"// GET the automation first and check enabled state\nconst auto = await api.get(`/automations/${id}`)\nif (auto.data.disabled) throw new Error(`Automation ${id} is disabled; re-enable before triggering`)","typeGuard":null,"tryCatchPattern":"try {\n  return await api.post(`/automations/${id}/trigger`, params)\n} catch (err) {\n  if (err.message === \"Automation is disabled\") {\n    // alert admin / skip pipeline instead of failing hard\n    return { skipped: true, reason: \"automation-disabled\" }\n  }\n  throw err\n}","preventionTips":["Check automation.disabled via the API before wiring external callers.","Remove webhook URLs of automations you disable.","Audit external integrations (Zapier/cron jobs) after disabling automations."],"tags":["automation","trigger","webhook","disabled"],"backgroundTag":"automation-is-disabled","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}