Skip to content

Webhook routing

Defang Agent edited this page Sep 17, 2026 · 1 revision

Standing-watch routing

A standing watch is identified by (topic, name). An absent name is the legacy unnamed watch, not a wildcard over every watch on that topic. Subscribing again updates just that identity; unsubscribing without a name removes only the unnamed watch. Names are case-sensitive, topics are not. This contract comes from local-channels 0.28.0 (PR #64).

Use named watches when one repository needs different workers for different events: an issue rule can select a triage profile while a CI rule selects a debugging profile. The Automations panel offers GitHub event presets and custom include/exclude predicates. Other webhook sources use custom rules.

Overlapping rules

The first accepting entry in subscription order wins, including wildcard and unnamed entries. A later, more specific topic does not automatically win. Updating a watch keeps its position. Prefer non-overlapping predicates; when migrating an existing broad watch, remove or narrow it before expecting later named rules to receive those same events.

The dispatcher still suppresses a new spawn when a live session claims the object. It batches by repository plus spawn configuration, so events choosing different profiles cannot be combined into one worker's batch.

Policy and profile resolution

The topic-keyed webhook.watchPolicy governs only unnamed watches. Named watches retain independent predicates across receiver restarts. The settings editor changes only the profile for unnamed watches, preserving any declared policy; named watches can edit both events and profile.

The effective profile is resolved by the spawn wrapper: valid watch profile, then valid box-wide hook profile, then the default agent. A missing profile is reported and falls back; it does not drop deliveries. Settings previews and profile-usage reporting resolve by both topic and name, using the same wrapper as actual launches.

Clone this wiki locally