Skip to content

feat(webhook): add WebhookTrigger class for Workflow Builder triggers#2615

Draft
zimeg wants to merge 4 commits into
mainfrom
eden/webhook-trigger
Draft

feat(webhook): add WebhookTrigger class for Workflow Builder triggers#2615
zimeg wants to merge 4 commits into
mainfrom
eden/webhook-trigger

Conversation

@zimeg

@zimeg zimeg commented Jun 2, 2026

Copy link
Copy Markdown
Member

Summary

This pull request adds a WebhookTrigger class to @slack/webhook for 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 like slack-github-action have to use raw fetch for triggers because the SDK lacks support.

WebhookTrigger mirrors IncomingWebhook's pattern:

  • Constructor takes URL + defaults (timeout, agent)
  • send(payload) POSTs arbitrary key-value data, returns { ok, body }
  • Reuses existing error infrastructure and User-Agent instrumentation

Requirements

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>
@changeset-bot

changeset-bot Bot commented Jun 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2dcef0f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.26549% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.91%. Comparing base (07744de) to head (2dcef0f).
✅ All tests successful. No failed tests found.

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     
Flag Coverage Δ
cli-hooks 88.91% <90.26%> (+0.01%) ⬆️
cli-test 88.91% <90.26%> (+0.01%) ⬆️
logger 88.91% <90.26%> (+0.01%) ⬆️
oauth 88.91% <90.26%> (+0.01%) ⬆️
socket-mode 88.91% <90.26%> (+0.01%) ⬆️
web-api 88.91% <90.26%> (+0.01%) ⬆️
webhook 88.91% <90.26%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

zimeg and others added 2 commits June 2, 2026 14:20
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 WilliamBergamin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@zimeg zimeg added enhancement M-T: A feature request for new functionality pkg:webhook applies to `@slack/webhook` semver:minor labels Jun 30, 2026
@zimeg zimeg self-assigned this Jun 30, 2026
@zimeg zimeg added the javascript Pull requests that update Javascript code label Jun 30, 2026
@zimeg zimeg modified the milestones: webhook@next, webhook@7.1.0 Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality javascript Pull requests that update Javascript code pkg:webhook applies to `@slack/webhook` semver:minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants