Skip to content

Create a scheduled automation

A scheduled automation is a module that runs on a timer — cron or interval — with no manual button. Use it for periodic server actions (timed broadcasts, map rotation), or to run over every online player on a schedule.

  1. In Automations, click New automation; the editor opens with an empty module. Set the header name to something descriptive.

  2. In the header trigger, write kind: 'schedule' and exactly one of two timers:

    • every — runs repeatedly, spaced by the given duration. Write values like 30m, 2h, 45s, or 1d.
    • cron — runs at fixed UTC clock times. Write a cron expression such as 0 */6 * * *; a sixth field for seconds in front and shortcuts such as @daily are accepted too. What heliana accepts in cron mode is in the Cron syntax reference.

    An automation never runs more often than once every 30 seconds, in either mode.

    An expression heliana can’t parse, or one that never runs, is refused at save time with a message naming the field: Cron expression is invalid or never runs for cron, Must be a duration: a positive number followed by d, h, m or s for every.

  3. In the same trigger, set for to choose who the automation acts on each time it fires:

    • 'server' — runs once for the whole server.
    • Each online player ('player') — runs once for every player currently online. Fields {player.name}, {player.eosID}, {player.steamID}, {player.squad}, {player.role}, {player.party}, {player.vehicle}, {player.isSquadLeader} (the text true or false), {player.team} and {player.squadIndex}, each read as ctx.player.<field> in the module. Decide with an if whether the actions run for that player; with no condition it runs for every online player.
  4. Write run(ctx) and act with ctx.rcon, ctx.ban, ctx.note or ctx.fetch. See Automation SDK reference.

  5. Press Test run, then click Save. A new automation is Enabled and runs from the next tick; switch it to Disabled first to save it off.

  6. Under the editor, Servers says where the automation runs. It starts on All servers, and clearing the field returns it to All servers; to stop it everywhere, switch it to Disabled. See Create an event automation.

import { defineAutomation } from '@heliana/automation'
export default defineAutomation({
game: 'squad',
name: 'Rules reminder',
async run(ctx) {
await ctx.rcon('AdminBroadcast Be kind to your teammates.')
},
trigger: { every: '30m', for: 'server', kind: 'schedule' },
})

A new organization has no scheduled automations: write your own or start from the examples.