feat(webhook): add WebhookTrigger class for Workflow Builder triggers#2615
feat(webhook): add WebhookTrigger class for Workflow Builder triggers#2615zimeg wants to merge 3 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.88% 88.90% +0.01%
==========================================
Files 62 63 +1
Lines 10239 10345 +106
Branches 451 462 +11
==========================================
+ Hits 9101 9197 +96
- Misses 1116 1125 +9
- Partials 22 23 +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>
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