Skip to content

Slack integration

Built-in types: slack_thread, slack_channel_digest (sources), slack (exposure). You need abt-core[slack] and a bot token in profiles.yaml under credentials.slack.

  1. Define source YAML under sources/ (channel + thread ts via vars).
  2. Reference {{ upstream('name') }} in a prompts/*.md template node.
  3. Define exposure YAML under exposures/.
  4. Wire them as workflow nodes: [START, source] → [source, prompt] → [prompt, agent] → [agent, exposure] in workflows/*.yaml edges:.

Same flow as Your first workflow. Operational details: Sources, Exposures. For agent mid-run search, see slack-tools.

Hands-on example: Tutorial 3: Incident Response — a complete Slack source → agent → Slack exposure workflow with credentials setup, dry-run, and vars.

Trying it without Slack

abt compile and abt watch list check the shape of Slack source, exposure and trigger YAML without a token, but neither contacts Slack. They do not validate config: keys either: a misspelled key (for example include_imgs for include_images) compiles cleanly, so check names against this page. To run the workflow end to end offline, stub the source and skip the exposure:

abt dispatch -s my_workflow --mock-sources '{support_thread: "Customer charged twice"}' --skip-exposures

Polling a channel, reading a real thread and posting a reply need a bot token and a real channel.

Replying while the agent works

A reply in the thread of a running agent reaches the agent before its next step, instead of waiting for the run to finish. See steering.

Images and PDFs in threads

slack_thread includes image and PDF attachments by default, so the agent sees them alongside the thread text. Set include_images: false in the source's config: to turn this off. Needs the files:read bot scope — see the scopes table below. The bot token is sent only to https://files.slack.com; an attachment whose url_private points anywhere else is skipped.

Attaching a file to the exposure's reply

Set attach_path in the slack exposure's config: to a local file path (image, PDF, ...) to upload it alongside the agent's answer instead of posting plain text. Leave it unset (the default) for a normal text post — there's no separate on/off flag, the key's presence is the switch. Needs the files:write bot scope.

Known limitation: Slack's file-upload API doesn't support Block Kit for its comment, so with attach_path set, the ABT_SLACK_FOOTNOTE footnote is appended as plain text instead of a separate footer.

Markdown → mrkdwn rendering

The slack exposure dispatcher automatically translates LLM output from standard Markdown into Slack's mrkdwn dialect before posting, so the agent does not need to learn Slack-specific syntax:

LLM writes Slack renders
**denied** denied (bold)
U0MOCK00001 <@U0MOCK00001> — a clickable mention expanded by Slack
```code``` untouched (code fence contents are preserved verbatim)

Italic (*text*) is intentionally left as-is, because Slack's mrkdwn treats single asterisks as bold rather than italic — silently translating would flip the agent's emphasis. Write _text_ for italics (works in both dialects).

Required Slack bot scopes

abt talks to Slack with a single bot token (xoxb-…). The OAuth scopes you need depend on which built-in features you enable: source, exposure, or approvals. Grant only the scopes you use.

Feature Slack API method(s) called Required bot scope(s)
slack_thread source ({{ source('…') }}) conversations.replies channels:history (public channels), groups:history (private channels), im:history (DMs), mpim:history (group DMs)
slack_thread source — image attachments (include_images, on by default) GET on the file's url_private Same as slack_thread, plus files:read. Without it, downloads fail with 403 and are skipped — the agent runs text-only, silently. Check with --debug if an image-dependent agent seems to be ignoring the image.
slack_channel_digest source ({{ source('…') }}) conversations.history, conversations.replies Same as slack_thread — reactions are embedded in the message object, no extra scope needed
slack_search retriever / abt-slack-tools conversations.history channels:history, groups:history, … (same as slack_thread_view); add users:read to show author names instead of ids
slack exposure (posting agent output) chat.postMessage chat:write; add chat:write.public only if the bot posts to channels it isn't a member of
slack exposure — attach_path (uploading a file with the reply) files.getUploadURLExternal, files.completeUploadExternal files:write
Approvals — post & resolve chat.postMessage, chat.update chat:write (Slack re-uses chat:write for both post and update; there is no chat:update scope)
Approvals — trigger_mode: reaction (default) reactions.get reactions:read
Approvals — trigger_mode: mention_command conversations.replies channels:history and/or groups:history (match the channel types you approve in)
Approvals — group-based allowed_approvers.groups: […] usergroups.list(include_users=True) usergroups:read
slack trigger — events: [reaction_added] (thread-root resolution) conversations.replies Same as slack_thread. Optional: without it the reaction still fires, but keys the reacted message instead of its thread — see watch
slack trigger — progress: true ("agent is working" thread status) assistant.threads.setStatus chat:write (already required for the slack exposure above)
slack trigger — progress_reaction: <emoji> reactions.add, reactions.remove reactions:write

Notes:

  • The bot must be a member of the channel it reads from or posts into, regardless of scope (that's a channel-membership requirement, not a scope). For sources and approvals, invite the bot with /invite @bot-name in the channel.
  • Under abt watch produce / abt watch consume, the progress and progress_reaction calls that clear the indicator are made by the consume process, so its bot token needs the same scopes — see watch.
  • Group expansion for approvals uses one usergroups.list(include_users=True) call, so usergroups:read is the only scope approvals need for groups.
  • To check a token's identity at runtime, call auth.test (no scope required). To review scopes, open the Slack App management console under OAuth & Permissions → Bot Token Scopes.
  • abt never asks for user-token scopes (xoxp-…). Everything uses a bot token.