The events
- Jobs
- Steps and tasks
- Machines
Subscribing
"secret": "..." if your receiver already has one, at least 16 characters. headers adds request headers for an endpoint that wants its own authentication beside the signature.
Filters
node.*: a machine has no owner.
There is no filter by job id, and that is a decision rather than a gap. A per-job subscription is one nothing would ever clean up, because the job it refers to gets archived and the subscription does not. “Call me when this job finishes” has a different answer: a notification channel at submit time, which is stored on the job and dies with it.
What arrives
The schema is fixed. Unlike a notification payload, which is a template an operator can edit, nothing here changes shape because wording was adjusted in the UI.
Headers
Verifying the signature
This is the most important section on the page. An endpoint that accepts an unverified webhook is a URL any machine on your network can post a “job completed” to, and yours probably goes on to move files or tell a tracker a shot is approved. The signature issha256= plus an HMAC-SHA256 of the raw request body with your secret as the key. Two rules:
- Hash the bytes you received, not a re-serialised object.
JSON.parsethenJSON.stringifyreorders keys and changes whitespace, and the signature will never match. - Compare in constant time.
===on a signature leaks it one character at a time to a caller willing to send a few thousand requests.
Delivery
At-least-once, never exactly-once. Trying to promise exactly-once over HTTP to a service you do not run is a promise that cannot be kept, so the envelope carries a stable delivery id instead and deduplicating is your side of the contract. Keep the ids you have handled for an hour and drop a repeat.
A subscription that switched itself off is restarted by enabling it, which clears the failure count and the reason at the same time:
When it does not arrive
In this order, because it is the order that finds the problem fastest.1
Send a test delivery
2
Read the attempts
status says your endpoint answered and how; a null status with an error says the farm never got that far, which is a DNS, firewall or certificate problem rather than a code one.These are held in memory, so a restart clears them. They exist for debugging in the next few minutes, not as an audit trail.3
Read the subscription
enabled, failures, error and last_status are the whole story. A false with an error means it switched itself off and says why.4
Check what you subscribed to
A job that completed while your subscription only asked for
job.failed is working exactly as configured. It is a more common answer than it sounds.A worked example
Update a shot in a production tracker when its render finishes, verifying the signature and deduplicating. This is the whole pattern, and everything else is a variation on it:Notification channels
A notification is a message for a person, attached to one job at submit time, and it dies with the job.job-errors is the batched digest that fires while a job is still running, which is the one that reports a render going wrong before it has finished going wrong.
Attach one at submit time. Notifications go on the step-tree body, name and steps, and a recipe does not take them: the farm refuses a recipe that carries notifications. The examples below read the steps back from a job built in the submitter, as the cookbook shows, and submit them with the notifications added:
value is what the channel needs: a configured channel’s id for Slack, Teams, Discord and a raw webhook; an address for email; a machine id for the desktop. The channels themselves are set up once in the app under Settings, Notifications, and a job refers to one rather than carrying a URL.
Use a notification when you want words in a room, and an event webhook when you want an event in a pipeline. Both at once is a perfectly ordinary setup: a Slack message for the lighting lead, and a signed callback for the tracker.