# Automation

> What your app does on its own: values computed on each change, checks before a save, tasks on a schedule, actions behind a button, calls to other services.

In GoLocomotive, automation is part of your app's code. You describe what must happen, and the agent writes it as a small piece of the server. It runs in the app itself, every time, for every way a change arrives: a screen, an import, your own AI.

## Kinds of automation

| you ask | what the agent writes | example |
|---|---|---|
| "keep this value up to date" | a step that runs after each saved change | the amount paid on an order, updated on each payment |
| "refuse this when…" | a check before the save, or a server rule | an order cannot move back from delivered |
| "every night, do…" | a task on a schedule | a reminder mail for open tickets older than 7 days |
| "a button that…" | a server action the screen calls | mail the invoice of this order to its client |
| "when a new client arrives, tell…" | a step after a create, that sends a mail or calls a service | a mail to the sales manager |
| "fetch the rates from…" | a call to another service, on a schedule or on an action | daily currency rates from a public API |

Schedules use your app's server clock in UTC: "every day at 23:00", "every Monday", "every hour".

## What makes it safe

- **It runs on the server**, never in a user's browser, so it runs the same way for everyone.
- **Checks run before the save**, side effects after it. A refused change triggers nothing.
- **A failure is loud.** A scheduled task that fails writes the reason in the app's log, and the schedule goes on.
- **It is reviewed like any change**: a card, a before and after when there is something to see, a line in the changelog when your users can notice it.

## Calling other services

Your app can call any service that has a web API: an accounting tool, a delivery service, a payment provider, an AI model. The agent writes the call in your app. The service's key is a secret of your app's server, never in the screens.

Your app can also receive calls: a custom web address that another system posts to, protected by a key or a sign in.

> **Note.** There is no visual flow editor. Each automation is code in your app, written by an agent and checked by you. A change to it is a request like any other.
