docs(examples): webhook automation tutorials — maintenance migration and offline-aware load balancer - #952
Draft
guthrie-vast wants to merge 1 commit into
Draft
docs(examples): webhook automation tutorials — maintenance migration and offline-aware load balancer#952guthrie-vast wants to merge 1 commit into
guthrie-vast wants to merge 1 commit into
Conversation
Two new examples under Notifications showing webhooks as an automation hook rather than a chat feed: - Migrate an Instance Before Scheduled Maintenance: react to client:upcoming_downtime, look up the maintenance window, copy state off the instance, rent a replacement on a different machine, destroy the original after instance_started. - Route Around Offline Instances with a Simple Load Balancer: react to client:instance_offline (plural payload), drain, blacklist the failed machine, rent a replacement elsewhere, re-admit only after the client's own readiness probe. Shared setup (receiver, webhook creation, local event simulator) lives in snippets/notifications/webhook-automation-setup.mdx and is imported by both pages. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two new client-facing examples under Examples → Notifications, plus a shared setup snippet. They show notification webhooks as an automation hook: each delivery carries a structured
dataobject, so an event can drive an action instead of a chat message.examples/notifications/maintenance-migration.mdx— Migrate an Instance Before Scheduled Maintenance. Onclient:upcoming_downtime, look up the maintenance window, copy state off the instance, rent a replacement on a different machine, and destroy the original afterinstance_started.examples/notifications/offline-aware-load-balancer.mdx— Route Around Offline Instances with a Simple Load Balancer. Onclient:instance_offline(pluralinstance_ids[]/machine_ids[]), drain, blacklist the failed machine, rent a replacement elsewhere, and re-admit only after the client's own readiness probe.snippets/notifications/webhook-automation-setup.mdx— shared receiver (verify → dedupe → enqueue → 2xx), webhook creation, and a local event simulator so readers can test without waiting for real maintenance.docs.json— both pages added to the Notifications nav group.Notes for review
upcoming_downtimepayload currently carriesinstance_id,machine_id,maintenance_idbut not the window timing. Tutorial 1 usesPOST /api/v0/machines/maintenances(renter-callable, verified against the web backend) to fetchstart_time/duration_hours. When the payload is extended to include those fields, the "Look Up the Maintenance Window" step becomes a fallback; the Note in that section is the spot to edit.instance_resumedfires on leaving Scheduling into running, stopped, or exited; Tutorial 2 checksactual_statusbefore re-admitting.Preview checklist
<WebhookAutomationSetup />)🤖 Generated with Claude Code