Major

Slack AI Agent: Build a Governed Escalation Workflow

A Slack AI agent can do more than answer in a channel. Build one that routes incidents, remembers each decision, and leaves repeatable work in a governed app.

Jose GironUpdated
On-call teammates reviewing an incident and coordinating an escalation

A Slack AI agent is software that reads messages and events, uses approved tools, and acts inside Slack. To build one that survives production, give it explicit triggers, keep workflow state in a database rather than in thread history, and gate every consequential write behind a person. Slack is where the agent talks. It should not be where the agent remembers.

That split is where Major fits. Slack is the interaction surface. Major is the enterprise platform where the agent builds the software it runs on: a governed app that stores incidents, suppresses duplicate escalations, and routes approved updates, while the model spends its reasoning only on judgment calls. Reason once, run forever.

Where a Slack AI agent helps

The useful jobs are bounded and recurring. Each one pairs an agent judgment with a deterministic action.

  • Incident escalation: read a PagerDuty incident, judge urgency, propose a channel post or ticket.
  • Channel summaries: read a configured channel and draft a recap for people who missed it.
  • Standup digests: assemble open work every weekday morning and post it to one approved channel.
  • Support triage: classify an inbound request and route it to the right owner.
  • Approved ticket creation: draft a Linear issue from a thread, then wait for a human to confirm.

None of these make Slack the system of record. Slack holds the conversation. PagerDuty holds the incident. Linear holds the work. The agent needs somewhere of its own to hold decisions, and that is the gap most Slack agent tutorials leave open.

What a Slack agent needs to work reliably

Start with events. A custom Slack app can subscribe to events and call Web API methods with a scoped token, and Slack's agent quickstart walks through the Slack CLI and a sample support agent. Pipedream's Slack integration covers the OAuth connection plus a catalog of triggers and actions if you would rather not hand-roll auth.

Three Web API methods carry most of the load. conversations.history reads a channel, conversations.replies reads a thread, and chat.postMessage writes. Check current scopes and rate limits in the Slack method reference before you ship, because they differ by method and token type.

Key everything on channel IDs, not channel names, since names change. Never treat a thread as durable memory. A thread is a transcript, and an agent that rebuilds its understanding from one on every run pays for the same reasoning again and gets slightly different answers.

There are three ways to get an agent into Slack, and they differ on surface, state and control:

  • Native Slack AI and Workflow Builder steps: surface is Slack itself, state is whatever the workflow carries, control is Slack's own plan and trigger rules. Slack's documentation notes that AI-generated workflows cannot start from list-item updates or webhooks, and some AI steps carry plan and channel constraints. That is a scoping fact, not a flaw.
  • A custom Slack app or agent: surface is Slack, state is whatever you build, control is whatever you build. Flexible, and you own the database, the approvals and the audit trail.
  • A Major app built by the agent: Slack is the surface, the app holds state in a managed database, and access is scoped, role-based and logged by the platform.

For a deeper look at the adjacent pattern, see Slack automation for alert triage.

Worked example: incident escalation and standup agent

This is a reference design, not a customer case study. It uses three connectors.

  • PagerDuty: reads incident summary, service and severity.
  • Slack: reads allowlisted channels, posts only to designated destinations.
  • Linear: writes an issue, only after approval.

The flow has four steps.

  1. Incident intake. A PagerDuty incident event fires the workflow. The app writes a row keyed on incident_id before anything else happens.
  2. Context collection. The app pulls recent messages from the incident's allowlisted Slack channel with conversations.history and conversations.replies, and stores a short reference and summary per message.
  3. Agent judgment. The agent labels urgency, decides whether escalation is warranted, and drafts the update. That is the entire model task.
  4. Approved action. A responder approves a Linear issue or a channel-wide chat.postMessage post. The app then records the action and a timestamp.

Deduplication is plain code. Each incident carries a last_notified_at field. If PagerDuty re-sends an event for an incident_id that was already escalated inside the window, the app records the event and skips the notification. No model call, no duplicate page.

On weekday mornings a scheduled run assembles every open incident and posts one digest to the approved channel. The model only phrases the digest. The list itself comes from a query.

The hard part is not the agent. It is evidence. If the agent summarizes a Slack thread and the thread is later edited or deleted, you need the summary and the reference stored at decision time, or the audit trail has a hole.

One position worth stating plainly: do not give a demo-grade agent broad posting or issue-creation rights for the sake of looking autonomous. Require approval on consequential writes, deduplicate before you notify, and name one source of truth per fact.

How to build the Slack escalation agent on Major

On Major, the agent builds the deterministic part once, then runs it.

  • Connectors: Slack, PagerDuty and Linear, each with credentials scoped to the reads and writes above.
  • State app: tables Incidents (PagerDuty ID, status, severity, owner), SlackEvidence (channel and message reference, timestamp, summary), Escalations (decision, approval, destination, action status) and AgentRuns (inputs, judgment, actor, timestamps).
  • Views: Open Incidents, Awaiting Approval and Escalation History, so responders manage the work in the app while the agent executes through it.
  • Agent judgment: interpret severity, decide if escalation is warranted, draft the message. Nothing else.
  • Triggers: a PagerDuty incident event plus a weekday morning schedule for the digest.
  • Deterministic logic: deduplication, status transitions and routing are code in the app, not a fresh round of reasoning.
  • Governance: responders approve writes under role-based access, and every read decision and action lands in the audit log.

The cost argument is structural. Re-reasoning every incident spends tokens on every run. Once the repeatable steps are an app, the model carries a smaller share of each run, so cost is front-loaded and then flat. The model still reasons for judgment. It just stops re-deriving the plumbing.

The same logic holds for control. Work that lives in an app is inspectable, attributable and permissioned, which is what governance for agentic AI asks for in practice, and it is how you scope AI agent access without trusting a prompt. For the wider pattern across tools, see AI agents for workflow automation.

Start building free on Major and describe the incident app in a sentence.

Start building on Major

Build a Slack incident agent that keeps its state in a governed app and routes approved actions across PagerDuty, Slack, and Linear. Major lets agents build the software they run on, so repeatable escalation steps run predictably while people retain control of consequential decisions.

Related articles

Frequently asked questions

How do I build an AI agent in Slack?
Start with Slack's CLI and agent quickstart, which scaffolds a sample support agent using the Bolt framework. That gets you a conversation. For recurring operational work, add a durable app behind it that stores state, deduplicates events, and gates writes. On Major, the agent builds that app for you.
What can a Slack AI agent do?
It can triage requests, summarize channels, route incidents, draft standup digests, and propose tickets. Keep each task bounded. Let the agent act alone on reads and drafts, and require a person to approve anything consequential, such as a channel-wide post or a new issue.
Can a Slack AI agent work with PagerDuty or Linear?
Yes, through authorized API connections rather than a native Slack feature. A PagerDuty incident event starts the flow, the agent gathers Slack context, and a human approves before a Linear issue is created. On Major, each connector is scoped to specific reads and writes.
How do you keep a Slack AI agent from repeating or losing work?
Store state outside the conversation. Key each record on an event ID such as `incident_id`, track `last_notified_at` to suppress duplicates, and write every decision to an audit log. Use bounded credentials so the agent can only do what its workflow requires.