Bridge relaycast channel traffic into n8n webhooks so agent findings can trigger Slack, Jira, PagerDuty, or any other n8n workflow target.
- Create a config file:
{
"bridgeId": "local-bridge",
"relaycastUrl": "https://api.relaycast.dev",
"relaycastToken": "rcast_...",
"routes": [
{
"channelPattern": "review-*",
"n8nWebhookUrl": "https://n8n.example/webhook/review-findings"
}
]
}- Install and build:
npm install
npm run build- Start the bridge:
npx relaycast-n8n-bridge start --config bridge.json- Check health:
npx relaycast-n8n-bridge health --config bridge.jsonThe bridge accepts relayfileUrl and relayfileToken as legacy aliases, but the runtime uses @relaycast/sdk because that package exposes the relaycast WebSocket client.
- Subscribes to relaycast channels matched from configured glob routes.
- Queues incoming relaycast messages for 100ms before flushing them.
- Forwards each message to matching n8n webhooks with 3-attempt exponential backoff.
- Writes permanently failed webhook deliveries to a local JSONL dead-letter file.
- Exposes
GET /healthwith counters for messages, retries, errors, reconnections, and per-route stats.
Each forwarded item is posted as JSON:
{
"source": "relaycast",
"channel": "review-123",
"message": {
"id": "msg_123",
"sender": "reviewer-bot",
"content": "High severity issue in src/api.ts for PR #42",
"timestamp": "2026-03-28T15:13:00.000Z",
"type": "message.created"
},
"metadata": {
"prNumber": 42,
"filePaths": ["src/api.ts"],
"severity": "high",
"agentRole": "reviewer",
"agentId": "agt_123"
},
"bridge": {
"id": "local-bridge",
"route": "route-1",
"processedAt": "2026-03-28T15:13:00.118Z"
}
}- Add a
Webhooktrigger node with methodPOST. - Point
n8nWebhookUrlin the bridge config to that trigger URL. - Add a
SwitchorIFnode using:{{$json.metadata.severity}}{{$json.metadata.prNumber}}{{$json.channel}}
- Route to Slack, Jira, PagerDuty, or other downstream nodes.
Typical examples:
review-*-> Slack notification for code review findingssecurity-*-> PagerDuty forcriticalorhighsynthesis-*-> Jira ticket creation usingprNumberand extractedfilePaths
npx relaycast-n8n-bridge start --config bridge.json
npx relaycast-n8n-bridge test --config bridge.json --route "review-*"
npx relaycast-n8n-bridge health --config bridge.jsonBuild the container:
docker build -t relaycast-n8n-bridge .Run it with a mounted config:
docker run --rm -p 8787:8787 \
-v "$PWD/bridge.json:/app/bridge.json:ro" \
relaycast-n8n-bridgeThe image starts with node dist/cli.js start --config /app/bridge.json. Override the command if you want to run health or test.