Automations
IF/THEN rules, scheduled restarts, announcements, and scheduled commands.
Updated Oct 30, 2026
Automations
Automations, a tab on the Server page, are visual IF/THEN rules. You pick a trigger and one or more actions, and Coalstack runs them automatically when the trigger fires. Rules are per-server and stored in that server's coalstack-server-config.json file. Scheduled Restarts and Scheduled Commands (below) are sections of this same page, not a separate screen.
Triggers
- A player joins: fires every time someone connects. Optionally restricted to a player's first-ever join to this server (Coalstack tracks every name it's ever seen join).
- A player leaves: fires every time someone disconnects.
- Server is empty for N minutes: fires once after the server has had zero players online for the specified duration. Resets when someone joins. Useful for stopping an idle server.
- Server crashes: fires when the server stops unexpectedly (the process exits without a deliberate "stop" command).
- Server finishes booting: fires when the server is fully started and ready for connections.
- On a time schedule every N minutes: fires repeatedly at a fixed interval, like a cron job.
- CPU usage exceeds N%: fires when the server process's CPU usage surpasses the threshold. Subject to a 5-minute cooldown to avoid spamming.
- Memory usage exceeds N MB: fires when the server process's memory usage surpasses the threshold. Same 5-minute cooldown.
Actions
- Run console command: sends an arbitrary command to the server via RCON. The command's result is logged to notifications.
- Stop the server: gracefully stops the server.
- Restart the server: gracefully restarts the server.
- Run a backup: creates a backup of the world folders immediately.
- Send a webhook: posts a JSON payload to a URL of your choice. It is separate from the per-server Discord/Slack webhook in Notifications and is useful for wiring a trigger into your own tooling.
Some actions need Coalstack Plus.
Multiple Actions
A single rule can have multiple actions. For example: "IF server crashes THEN run a backup AND restart the server." Actions run in sequence; if one fails (a backup runs out of disk space, say), the rest still execute.
How They Run
Event-based triggers (player join, player leave, server empty, crash, server online) are detected by scanning every new log line for the matching pattern. Time-based triggers (scheduled, CPU high, memory high) are evaluated by a Rust-side scheduler that runs every 60 seconds. Both paths call the same action dispatch logic. Every execution is logged to Notifications with the command and its result.
Conditions, Cooldowns & Circuit Breaker (Coalstack Plus)
Any rule can be narrowed with a condition: only fire if the player count is above or below a number, or only during a time window (e.g. no restart pings between midnight and 8am). A cooldown stops a rule from re-firing again for N minutes after it last ran. A circuit breaker auto-pauses a rule (with a notification) if it fires more than a set number of times in an hour; a safety net for crash-triggered rules that could otherwise loop if something's actually broken.
Scheduled Commands & Restarts
In addition to the full rule-based system above, the Automations page has three simpler built-in schedulers for the most common use cases.
Scheduled Restarts
Turn on automatic restarts with a configurable interval in hours, with optional warning messages counting down beforehand. Coalstack checks every minute whether a restart is due and issues a graceful restart if the server is running. The last restart time is displayed. This needs Coalstack Plus.
Announcements
Free-form messages on their own repeating interval, with no restart attached: a welcome message, a rules reminder, or a Discord invite link. This needs Coalstack Plus.
Scheduled Commands
Add any number of console commands that repeat on their own interval. For example,save-all every hour, or a broadcast every 30 minutes to warn players about an upcoming restart. Each command has its own independent interval, enabled toggle, and last-run timestamp. Checked every 15 minutes while the server is running. This needs Coalstack Plus.
save-all
say Server restarting in 5 minutes
