Commit f4d47ed
feat(slack): reusable custom bot credentials, slack_v2 block (preview), redesigned trigger (#5323)
* feat(slack): enable assistant-agent tools via assistant:write scope
Add assistant:write, app_mentions:read, and im:history to the Slack bot
OAuth scopes so the Set Assistant Status / Title / Suggested Prompts tools
(assistant.threads.*) work with users' existing Slack credentials — no new
app or credentials required. Restore the action_assistant trigger capability
(scope assistant:write) in the manifest generator.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpeT8J5yVCrrNQB9Hzm9uS
* Add slack trigger
* fix channel picker in slack trigger
* improvement(slack-trigger): reorder app type, gate account to sim mode, add channel-id input
* fix(slack-trigger): drop unmapped events from filter, resolve oauth token for reaction text + file downloads
* fix(slack-trigger): empty operation selection fires nothing; resolve token via credential owner not execution actor
* fix(slack-trigger): ignore message edit/delete/system subtypes; prefer channel picker over stale manual ids
* feat(slack-trigger): single-event model with contextual filters and full event catalog
* fix(slack-trigger): apply event/channel/bot filters on custom-app path too
* fix(slack-trigger): don't drop edit/delete events when channel_type is absent
* feat(slack): reusable custom bot credentials, slack_v2 block, interactivity triggers
- Custom bot as a workspace service-account credential (set up once, shared
ingest URL /api/webhooks/slack/custom/{credentialId}, reused across triggers
and actions)
- slack_v2 action block: credential-based Custom Bot auth alongside Sim OAuth;
v1 hidden from toolbar
- Interaction triggers (block_actions / view_submission) with optional
action/callback id filter; settings.interactivity in generated manifests
- Setup wizard: name + description, full permissions by default with
ChipDropdown customization; reconnect mode rotates secrets in place
- Centralized service-account token resolution (unknown provider fails loudly)
- Shared Slack webhook fan-out dispatcher for native + custom ingest routes
* chore(api-validation): bump route baseline to 924 after staging merge
* feat(slack): preview-gate slack_v2 and the custom-bot credential surfaces
slack_v2 (block + hosted slack_oauth trigger) ships preview: true — hidden
from all discovery until revealed via block-visibility AppConfig or
PREVIEW_BLOCKS. v1 stays toolbar-visible with the legacy slack_webhook
trigger until v2 GAs. The integrations-page custom-bot setup surface rides
the same flag via isHiddenUnder(slack_v2); placed instances, existing
credentials, and ingest/execution paths are never gated.
* fix(slack): v1 keeps slack_webhook trigger subblocks; handle object-form event channels
- v1 spread had been swapped to slack_oauth's trigger subblocks (shared with
v2), leaving its slack_webhook deploy path without signing-secret config
(Bugbot high). v1 now carries the legacy trigger set again; v2 swaps them
for slack_oauth's.
- resolveSlackEventChannel reads channel.id for channel_created/channel_rename
payloads, so channel filters no longer drop every rename event.
* fix(slack): default absent appType to custom at deploy; deactivate custom-bot webhooks on credential delete
- appType is hidden and seeded 'custom' by value(), which only covers
editor-created blocks; defaultValue now persists it via buildProviderConfig
and the deploy fallback flips to custom (the only exposed mode this ship)
- deleting a slack-custom-bot credential now also deactivates provider='slack'
webhooks routed by that credential id, not just native slack_app rows
* fix(slack): resolve credential owner for deploy-time team_id lookup
A teammate deploying a trigger wired to a shared Slack credential isn't the
credential owner; refreshAccessTokenIfNeeded only loads tokens for the owning
user. Resolve the account owner first, mirroring the runtime formatInput path.
* chore(slack): reconcile staging merge
- nullable webhook.path coalesced at correlation/payload/tiktok boundaries
- slack dispatch delegates to staging's dispatchResolvedWebhookTarget
(shared preprocess/deployment/filter/enqueue lifecycle), keeping the
skip-reason diagnostics; route tests reworked around that seam
- api-validation route baseline 924 -> 926
* fix(slack): workspace-scope bot credentials at deploy; recreate webhooks on routing transitions
- a bot credential id is semi-public (embedded in Slack Request URLs), so the
custom deploy branch now rejects credentials outside the workflow's workspace
- needsRecreation also compares path/routingKey, so a row from an older routing
model can't survive redeploy as a stale delivery surface
* test(slack): pin fail-closed behavior for empty/missing event selection
* fix(slack): 409 on custom-bot name collision instead of silently returning the existing credential
The service-account dedupe matches on displayName, which defaults to the Slack
team name — shared by every bot in that workspace. A second unnamed bot create
returned the first credential as success, orphaning the new id already pasted
into the Slack Request URL. Same-id replays stay idempotent; different-id
collisions now fail loudly so the wizard prompts for a distinct name.
* fix(slack): reconnect surfaces Atlassian error codes and persists name/description edits
- PUT credential route now returns the Atlassian provider code (providerErrorCode
-> code) so reconnect failures map to specific token/domain messages, matching create
- Google/Atlassian reconnect send + seed displayName/description (parity with Slack);
edits are no longer silently discarded, and empty fields don't clobber existing values
* fix(slack): require bot name; propagate rotated bot_user_id to webhooks on reconnect
- the setup wizard now requires a bot name (canAdvance), so the credential name,
manifest app name, and uniqueness key all use the user's choice instead of the
shared Slack team-name fallback that collided for a second bot in one workspace
- reconnect that changes the bot user id (recreated Slack app) now updates the
bot_user_id cached in each bound webhook's providerConfig, so reaction
self-drop keeps working instead of letting the bot's own reactions re-enter
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent f60d41a commit f4d47ed
59 files changed
Lines changed: 20641 additions & 438 deletions
File tree
- apps
- docs/components/workflow-preview
- sim
- app
- api
- auth/oauth
- token
- credentials
- [id]
- tools/slack/channels
- webhooks
- slack
- custom/[credentialId]
- workspace/[workspaceId]
- integrations
- [block]
- components
- connect-service-account-modal
- connect-slack-bot-modal
- connected/[credentialId]
- w/[workflowId]/components/panel/components/editor
- components/sub-block
- components/credential-selector
- background
- blocks
- blocks
- hooks/queries
- lib
- api/contracts
- core/config
- credentials
- orchestration
- integrations
- oauth
- webhooks
- providers
- workflows/subblocks
- workspace-events
- tools
- triggers
- slack
- packages
- db
- migrations
- meta
- emcn/src/components/wizard
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | | - | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | | - | |
21 | 18 | | |
22 | 19 | | |
| 20 | + | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
| |||
170 | 168 | | |
171 | 169 | | |
172 | 170 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 171 | + | |
186 | 172 | | |
| 173 | + | |
187 | 174 | | |
188 | 175 | | |
189 | 176 | | |
190 | 177 | | |
191 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
192 | 186 | | |
193 | 187 | | |
194 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
20 | 31 | | |
21 | 32 | | |
22 | 33 | | |
23 | 34 | | |
| 35 | + | |
24 | 36 | | |
25 | 37 | | |
26 | 38 | | |
| |||
262 | 274 | | |
263 | 275 | | |
264 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
265 | 334 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
222 | 224 | | |
223 | 225 | | |
224 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
225 | 285 | | |
226 | 286 | | |
227 | 287 | | |
| |||
264 | 324 | | |
265 | 325 | | |
266 | 326 | | |
267 | | - | |
268 | | - | |
269 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
270 | 366 | | |
271 | 367 | | |
272 | 368 | | |
| |||
511 | 607 | | |
512 | 608 | | |
513 | 609 | | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | 610 | | |
522 | | - | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
523 | 618 | | |
524 | 619 | | |
525 | 620 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| |||
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
98 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
99 | 109 | | |
100 | 110 | | |
101 | 111 | | |
| |||
0 commit comments