feat(webhook): add WebhookTrigger class for Workflow Builder triggers#2615
feat(webhook): add WebhookTrigger class for Workflow Builder triggers#2615zimeg wants to merge 4 commits into
Conversation
Add a new WebhookTrigger class that mirrors IncomingWebhook but handles
Workflow Builder webhook triggers which return JSON responses with
arbitrary payloads (vs plain text "ok" from incoming webhooks).
- Constructor takes URL + defaults (timeout, agent) — same pattern
- send() accepts arbitrary key-value payload, returns { ok, body }
- Reuses existing error infrastructure and User-Agent instrumentation
- Enables consumers like slack-github-action to use the SDK instead
of raw fetch for WFB triggers
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2615 +/- ##
==========================================
+ Coverage 88.90% 88.91% +0.01%
==========================================
Files 63 64 +1
Lines 10256 10369 +113
Branches 452 464 +12
==========================================
+ Hits 9118 9220 +102
- Misses 1117 1127 +10
- Partials 21 22 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Workflow Builder webhook trigger inputs are always string values. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
WilliamBergamin
left a comment
There was a problem hiding this comment.
Gave this a quick look and it looks good 💯
if we need to dry this up in the future we can look into it at that time
# Conflicts: # packages/webhook/package.json # packages/webhook/src/index.ts
Summary
This pull request adds a
WebhookTriggerclass to@slack/webhookfor Workflow Builder webhook triggers.Currently the package only supports incoming webhooks (
IncomingWebhook). WFB webhook triggers differ — they accept arbitrary JSON payloads and return JSON responses (vs plain text). Consumers likeslack-github-actionhave to use rawfetchfor triggers because the SDK lacks support.WebhookTriggermirrorsIncomingWebhook's pattern:send(payload)POSTs arbitrary key-value data, returns{ ok, body }Requirements