{"record":{"id":"73240012a7ef63aa","repo":"Budibase/budibase","slug":"slack-integration-is-not-configured-for-this-agent","errorCode":null,"errorMessage":"Slack integration is not configured for this agent","messagePattern":"Slack integration is not configured for this agent","errorType":"http","errorClass":"HTTPError","httpStatus":400,"severity":"error","filePath":"packages/server/src/sdk/workspace/ai/deployments/slack.ts","lineNumber":50,"sourceCode":"\nconst normaliseAppName = (name: string) =>\n  truncate(name.trim() || \"Budibase Agent\", MAX_APP_NAME_LENGTH)\n\nconst normaliseBotDisplayName = (name: string) => {\n  const safeName = name\n    .trim()\n    .toLowerCase()\n    .replace(/[^a-z0-9._-]+/g, \"-\")\n    .replace(/^-+|-+$/g, \"\")\n  return truncate(safeName || \"budibase-agent\", MAX_BOT_DISPLAY_NAME_LENGTH)\n}\n\nexport const validateSlackIntegration = (\n  agent: Agent\n): ResolvedSlackIntegration => {\n  const integration = agent.slackIntegration\n  if (!integration) {\n    throw new HTTPError(\n      \"Slack integration is not configured for this agent\",\n      400\n    )\n  }\n\n  const botToken = integration.botToken?.trim()\n  const signingSecret = integration.signingSecret?.trim()\n\n  if (!botToken || !signingSecret) {\n    throw new HTTPError(\n      \"Slack integration requires botToken and signingSecret\",\n      400\n    )\n  }\n\n  return {\n    botToken,\n    signingSecret,","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/ai/deployments/slack.ts#L32-L68","documentation":"This HTTP 400 error is thrown by validateSlackIntegration in packages/server/src/sdk/workspace/ai/deployments/slack.ts when the agent being deployed or saved has no slackIntegration object at all. Slack-based deployments (webhook URL generation, app manifest creation, OAuth exchange) require the agent to carry a configured Slack integration first. The guard runs before token validation.","triggerScenarios":"Deploying a Slack-enabled agent whose agent.slackIntegration is undefined/null - e.g. requesting a Slack webhook URL or Slack app creation for an agent that was created without Slack settings, or after a save that stripped the integration field.","commonSituations":"Agent was created via API/automation without the slackIntegration block; a migration or schema change dropped the field; the caller deployed to Slack when the agent was actually configured for a different channel (e.g. Teams only).","solutions":["Add a slackIntegration object to the agent with botToken and signingSecret before deploying or building webhook URLs.","Re-save the agent through the agent configuration API ensuring the slackIntegration block is included in the payload.","Verify you are targeting the correct agent and channel - use the Teams path if the agent is Teams-configured.","If a save is dropping the field, check the API payload/schema for omitted or misnamed keys (slackIntegration)."],"exampleFix":"// before\nawait deployAgent({ agent, provider: \"slack\" }) // agent.slackIntegration === undefined\n// after\nagent.slackIntegration = {\n  botToken: process.env.SLACK_BOT_TOKEN,\n  signingSecret: process.env.SLACK_SIGNING_SECRET\n}\nawait updateAgent(agent)\nawait deployAgent({ agent, provider: \"slack\" })","handlingStrategy":"validation","validationCode":"if (!agent.slackIntegration) {\n  throw new Error(`Agent ${agent._id} has no Slack integration configured; add slackIntegration before deploying to Slack`)\n}","typeGuard":"const hasSlackIntegration = (\n  agent: Agent\n): agent is Agent & { slackIntegration: NonNullable<Agent[\"slackIntegration\"]> } =>\n  agent.slackIntegration != null","tryCatchPattern":"try {\n  await deployAgentToSlack(agent)\n} catch (e) {\n  if (e instanceof HTTPError && e.message.includes(\"Slack integration is not configured\")) {\n    // redirect user to agent Slack settings\n  }\n  throw e\n}","preventionTips":["Gate the Slack deploy UI action on the presence of a slackIntegration config.","When creating agents via API, include the full integration block in the payload.","Check agent channel type before invoking Slack-specific endpoints."],"tags":["validation","slack","agent-config"],"backgroundTag":"missing-integration-config","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}