Files
twenty/packages/twenty-apps/public/slack
Abdul Rahman 72322a4d72 feat: Slack conversational assistant (#22984)
## Summary

Lets workspace members talk to the Twenty CRM agent from Slack —
`@mention` the bot in a channel or DM it, and it answers in-thread using
the `slack-assistant` agent and its assigned role.

## How it works

Slack Events webhook → app route verifies signature → **ack in <3s** and
enqueue a `slackAssistantRequest` → worker posts a placeholder
immediately, then fetches recent thread/DM history (excluding the
current message and placeholder), runs `runAgent`, and updates the
placeholder with the answer. After a successful reply, the thread stays
subscribed (24h TTL, renewed on each reply) so follow-ups work without
re-mentioning.

## App-owned orchestration

Protocol + orchestration live in `twenty-apps/public/twenty-slack`
(events resolver, enqueue, worker, team claim KV, thread subscription).
The server provides shared primitives (app routes, `runAgent`, app KV,
connection OAuth).

## Notes

- Agent role is bound via `roleUniversalIdentifier` on install. Default
**Slack Assistant** role: read/create/update/soft-delete on people,
companies, opportunities, notes, and tasks; **workspace members stay
read-only**; hard destroy stays off. Admins can tighten the role in
Settings.
- Setup (signing secret, event subscriptions, scopes) is in the app
README.
- Long-lived Slack bot tokens (no refresh token) are treated as
non-expiring.
- Multi-turn: recent Slack thread/DM messages are prepended into the
agent prompt.
- Replies are non-streaming for now (placeholder + final `chat.update`);
progressive streaming is a follow-up.

## Follow-ups

- **Streaming replies** — progressive edits while the agent runs.
- **Per-user / per-channel permissions** — Slack→Twenty user mapping and
optional channel rules (open by default; admins can narrow).
- **Other platforms** — Discord/Teams can reuse the same patterns; only
Slack protocol is in this PR.

## Screenshots


https://github.com/user-attachments/assets/3a72770a-93fa-411d-b4aa-2f741afbcee1


<img width="426" height="686" alt="Screenshot 2026-07-27 at 3 58 38 PM"
src="https://github.com/user-attachments/assets/b0a62e7c-c5e4-4c96-9389-5e47d7ef8c77"
/>
<img width="1053" height="726" alt="Screenshot 2026-07-29 at 12 54
45 AM"
src="https://github.com/user-attachments/assets/4e14b3fb-fbe5-4f4d-a380-cc45cc60a01a"
/>
2026-07-30 09:36:38 +00:00
..

Slack

Your CRM, in the conversation — ask Twenty anything from Slack and post back to any channel.

What you get

  • A CRM assistant in Slack@twenty how many open opportunities do we have? or @twenty create a company called ACME. It answers in-thread, remembers the thread, and can read, create, update and soft-delete records
  • Follow-ups without re-mentioning — once it has replied in a thread you can keep talking to it for 24 hours
  • Slack steps for your workflows — post, update or delete messages, send ephemerals, add reactions, list channels
  • Send from anywhere in Twenty — the Send Slack message command opens a side panel to pick a channel and post

🤖 The assistant

Mention the bot in a channel or DM it. It replies in the thread with your CRM data, using the recent conversation as context.

Anyone who can message the bot acts with the Slack Assistant role, which by default can read, create, update and soft-delete people, companies, opportunities, notes and tasks. Workspace members stay read-only and hard delete is off. Tighten the role in Settings → Roles if you want a narrower bot.

One Slack workspace answers into one Twenty workspace.

🧰 The workflow steps

Step Slack API
slack-post-message chat.postMessage
slack-post-ephemeral-message chat.postEphemeral
slack-update-message chat.update
slack-delete-message chat.delete
slack-add-reaction reactions.add
slack-list-channels conversations.list

Pick a workspace shared or just for me Slack connection; steps run with that token.

💳 Billing

Free — no credits, no metering.

📌 Heads up

You need to create a Slack app and connect it — see SETUP.md. The assistant needs a few extra steps (signing secret and event subscriptions) on top of the base connection.