Post webhook events to Slack
When a system sends an event to a webhook, its title and key details are posted to your team channel, optionally only for the event names you care about.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/post-webhook-events-to-slack/
Paste into Claude, ChatGPT, Cursor or any agent.
- Category
- Engineering · Dev ops
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/post-webhook-events-to-slack
Set it up with the CLI
- Add it. Copies the folder into
zaps/post-webhook-events-to-slack/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/post-webhook-events-to-slack - Fill in the values in
config.ts, and in any other file the list marks. Replace each one as its comment and SKILL.md say. - Deploy it. Asks for any value still left, signs you in to Zapier if you aren't, then publishes it to your account.
npx zap-pack deploy post-webhook-events-to-slack - Check it. Its recent runs, with status and errors.
npx zap-pack logs post-webhook-events-to-slack
zaps/post-webhook-events-to-slack/
- README.mdWhat it does, for people
- SKILL.mdHow an agent sets it up: what to ask you, and how to test it
- config.tsIts settings 1 to fill in
- connections/slack.tsThe
slackaccount it uses - triggers/hook.tsWhat starts it:
webhookhook_v2 - workflow.tsThe code; each
ctx.stepis a step in the Zap
Agents: add --yes to any command so it never prompts. When it needs an answer only the user can give, it stops and names the flag that supplies it.
SKILL.md
View MarkdownWhat it does
- Trigger: a system posts each event to a Webhooks by Zapier catch hook (
webhook,hook_v2). - Filter (in code): the event name is read from the first of the
EVENT_FIELDSthat has a value (event, thentype). IfALLOWED_EVENTSlists any names, an event not on the list stops the run and posts nothing. The list is empty by default, so every event posts. - Slack: one message is posted to the team channel. The first line is the title in bold, taken from the
titlefield and falling back to the event name. Under it, each field inFIELDSthat has a value is written as*Label*: value. Nested values are written as compact JSON. Mentions and link previews are switched off, so an event never pings the whole channel.
Ask the user
Each REPLACE_… value is set per person. Resolve channel names to IDs with the user's Slack connection; don't ask them to paste an ID you can look up.
| Setting | What goes there |
|---|---|
SLACK_CHANNEL |
The channel that gets the notices, looked up from the user's Slack connection. The Slack app must be in that channel. |
Also review the constants at the top of workflow.ts with them: EVENT_FIELDS (which payload fields hold the event name), ALLOWED_EVENTS (the event names worth posting, empty for all), TITLE_FIELD and FIELDS (which payload fields to show, and their labels).
- What does the sender's payload look like? The payload shape differs per sender, so ask for a sample, or have them send one test event to the hook, and change the field names in
EVENT_FIELDS,TITLE_FIELDandFIELDSto match before building. The defaults are only a guess. - Which events should reach Slack? Put their exact names in
ALLOWED_EVENTS, or leave it empty to post everything.
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/post-webhook-events-to-slack, replace each REPLACE_… value as this file says, then run npx zap-pack deploy post-webhook-events-to-slack, which signs the user in to Zapier when it gets there. Otherwise build with Zapier MCP, as the steps below say. Either way, name the workflow Post webhook events to Slack (zapier.sh/post-webhook-events-to-slack): zap-pack takes that name from this file's title, so leave the title as it is, and with Zapier MCP give the workflow that name when you create it. No Zapier MCP tools? Read https://docs.zapier.com/mcp/get-started/quickstart.md and follow the page for the app you are running in to get the user connected, then continue with this build.
- Accounts: bind
slackto the user's Slack connection for the workspace with the team channel. Webhooks by Zapier needs no connection. - Source: publish
workflow.tsandconfig.ts, with eachREPLACE_…replaced by the user's answer and the field constants adjusted to their payload.triggers/hook.tsandconnections/are settings, not code: set the workflow's trigger and connection bindings from them. The trigger file names the app by its slug; for the trigger'sselected_api, callsearch_triggerswith that slug, find the row whosekeyis the trigger'sevent, and use<app_key>@<app_version>from it. - Build guide: load Zapier's build guide with
get_zapier_skill("zapier:build-workflows")and follow it to create, test and publish the workflow. - Fields: inspect each action's fields with the user's connections before the first test run, and fix any key in
workflow.tsthat doesn't match.
Test it
Run this sample as a draft test run (run_workflow_draft in Zapier MCP) before publishing, using a test channel, not the team's real one:
{
"event": "[install-test] deployment.failed",
"title": "[install-test] Deployment failed for example-service",
"description": "The release build exited with an error.",
"severity": "high",
"source": "ci",
"url": "https://example.com/deployments/install-test-1",
"details": { "attempt": 2, "region": "us-east-1" }
}
Check that one message appears in the test channel with the title in bold followed by the labelled fields. If ALLOWED_EVENTS is set, run a second sample whose event is not on the list, and check that the run finishes as skipped with reason event-not-in-allowed-list and that nothing appears in the channel. If run-status tools aren't available, check the test channel in Slack directly. Ask the user to delete the test messages; the agent doesn't delete them. Then publish and confirm the trigger is active.
Notes
- After publishing, give the user the catch hook URL to point their system at. Anyone with that URL can post into the channel, so keep it out of shared documents and public repositories.
- Values are posted as the sender wrote them. Don't add fields that carry secrets or personal data to
FIELDS, because everyone in the channel can read them. - Fields not listed in
FIELDSare ignored. To show a nested field, list its top-level key and it is written as compact JSON. - To route some events to a different channel or tag an on-call person, add a second Slack step filtered on the event name.