Build an event-driven pub/sub bus with webhooks, HTTP services, and Slack
Ready for 3.0What this workflow does
This workflow has 23 nodes and runs when an HTTP POST request hits its webhook URL (plus 1 other trigger). Along the way it connects Slack.
How it runs
Trigger: When an HTTP POST request hits its webhook URL (plus 1 other trigger).
- Merge: merges the data from its input branches
- Set - Event Bus Config (Edit Fields (Set)): sets 9 fields: eventStoreUrl, eventStoreAckUrl, dlqUrl…
- Code: runs custom JavaScript code
- If: checks a condition and branches into true / false
- HTTP Request: calls an HTTP API (POST)
- Respond - Invalid Envelope (Respond to Webhook): sends the response back to the webhook caller
- Respond - Event Accepted (Respond to Webhook): sends the response back to the webhook caller
- Switch: routes items into 2 branches
- Subscriber - Order Service (HTTP Request): calls an HTTP API (POST)
- Subscriber - Notification Service (HTTP Request): calls an HTTP API (POST)
…plus 11 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (11)
- Webhook
n8n-nodes-base.webhook - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Merge
n8n-nodes-base.merge - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Respond to Webhook
n8n-nodes-base.respondToWebhook - HTTP Request
n8n-nodes-base.httpRequest - Switch
n8n-nodes-base.switch - Wait
n8n-nodes-base.wait - Slack
n8n-nodes-base.slack
From the author
Quick overview This workflow implements an event bus in n8n that accepts event envelopes via webhook or Execute Workflow, validates and logs them to an external event store, routes events to multiple HTTP subscriber endpoints, and handles failures with…