A scheduled task
Atask is a stack with a schedule and no input or response.
scheduleis a list. Each entry has astartsOnand, to repeat, afreqinterval in seconds.every("15m"),every("1d")andevery("1w")spell it readably. Omitfreqand the task runs once atstartsOn.startsOn(and an optionalendsOn) is a timestamp string with a zone, never an epoch number.- There is no cron syntax and no time zone, so a fixed
startsOndrifts an hour at each daylight saving change. To run at a local time, run hourly and check the local hour in the stack. active: falsedeploys the task without running it.
.registerTasks([nightlyCleanup, launchAnnouncement]).
Work that a request starts but does not wait for is not a task. Call a function with a
background runtime from the endpoint instead; see
APIs, functions and middleware.
Platform triggers
A trigger runs a stack when something happens. Its inputs are fixed by its type, so it takes noinput. Instead, stack is a callback that receives a typed handle t, and reading a name the
type does not have is a compile error. Both triggers here are config-only: they take no
response. Register them with .registerTriggers([...]).
Triggers that belong to another object live with it: table triggers on
Data and tables, realtime triggers on
Realtime, and MCP server and agent
triggers on AI agents and MCP servers.
React to Xano branch changes: workspace triggers
AworkspaceTrigger fires when a Xano branch is created (branch_new), merged into another
(branch_merge), or made live (branch_live). Pick the actions in actions.
t exposes t.action, t.from_branch and t.to_branch.
React to errors: error triggers
AnerrorTrigger fires on an error signature, which groups repeats of the same error. It fires
when a signature is first seen (t.event is new), when one marked fixed happens again
(regression), and when one is marked fixed (fixed).
t.event and t.error("code") / t.error("message"), t exposes the signature
(t.id, t.signature), where it happened (t.caller, t.statement, t.actor), and its
counts and times (t.count, t.first_seen, t.last_seen, t.fixed_at).
Tasks and triggers fire on their own once deployed. To run one on demand while you develop, ask
your coding agent to run it through the Xano Engine’s MCP server.
Next
- Every trigger type’s actions and handle: object kinds reference.
- Serve websocket channels and gate who connects: Realtime.
- Test what these objects do: Tests.