Build And Verify An Automation
Use a trigger, conditions and ordered actions, then decide what happens if recovery fails.
Choose a starting point
Open Automations and create a rule. Choose a preset for a service, an agent event or a custom event; its When field is filled in for you. Blank starts without an example. Switch between Visual Flow and Structured Form using the two builder buttons.
Set the trigger
Choose the event and its target. A wire-added event describes a change to the map. A physical link failure needs a port check, device reading or pushed event. For a custom event, choose a stable name such as backup.finished and define the data fields your sender will provide.
Add conditions
Conditions decide which branch should run. Match the reported value and type: the number 1 is different from text describing a healthy state. Collapse sections while working on another branch. Drag conditions, actions or ELSE branches to reorder them. Disable an item to keep its configuration without using it.
Order the actions
Add an alert, service operation, file transfer, script or API operation. A transfer selects a locally configured job on an agent. It copies between paths available to that agent, including mounted shares. It is not an automatic SFTP session.
Verify recovery
A successful start command means the command was accepted or completed. It does not prove the service stayed up. Configure recovery verification to wait for a fresh healthy reading, then set a timeout and error action. ELSE chooses another condition branch; it does not catch a failed restart.
Limit repeat work
Set matching cycles, cooldown and attempt limits. Try a failed check, a failed command and a recovery timeout before enabling a rule against important systems. Check Activity for what happened and whether the result was verified.
Send a custom event
Use an organization event credential and the organization-scoped API path. Keep the token outside source code. Scripts that report ongoing health should use telemetry or an Agent Script check; an event reports one occurrence.
See Scripts And Monitoring Recipes for JSON output examples and the difference between stdout values and process exit codes.