Procedures
Some things an app must never do in the browser: sign in to another company's service with a password, use a secret key, or keep a login token. A backend procedure is a small piece of code that runs on Operator's servers instead. The app asks it for a result and gets only that result back. Passwords, tokens and the other service's raw responses stay on the server.
Procedures are available in Pro apps. You describe what you need in plain words, and the App Builder writes, tests and connects the procedure.
When you need one
- Another service has its own way of signing in. For example, an address database that wants a user name and password and then hands out a short-lived token.
- A calculation or check uses a secret. The browser must never see that secret.
- Several calls need to be combined. For example: look something up in one system, check it against another, and return one clean answer.
For work that must happen while nobody has the app open, use triggers.
Web Requests or Procedures?
Both keep credentials on the server. The difference is how much they can do, and what they cost.
| Web Requests | Procedures | |
|---|---|---|
| What it does | One call to one service | Any secure logic: several calls, custom sign-in, checks with a secret |
| Sign-in it handles | None, a stored key, or a standard company sign-in | Any, including non-standard logins and signed requests |
| Remembers a login token | No | Yes, for up to 24 hours |
| Code | None — just settings | A small script the App Builder writes |
| Cost (after BETA) | Included in the daily Cloud cost | Daily cost plus 0.1 credit per run |
Rule of thumb: start with a Web Request. Use a procedure only when a single standard call is not enough.
Examples:
- "Show today's exchange rates from a public rates service." → Web Request — one call, no sign-in.
- "Look up a parcel's status with our courier, using our API key." → Web Request — one call, a stored key.
- "Sign in to our courier with its custom login, keep the token, then book a shipment." → Procedure — non-standard login and several steps.
- "Check the customer with our credit agency and show only the rating." → Procedure if the agency needs signed requests or a login step; otherwise a Web Request is enough.
The App Builder follows the same rule and tells you when it chooses a procedure.
Asking for a procedure
Our address provider DataMap signs in with a user name and password and returns
a token. Let the app search addresses as the user types, and keep the token so
we don't sign in on every search.
When the user presses "Check credit", ask our credit agency's service about this
customer and show only the rating and the limit.
Add a "Validate VAT number" button that checks the number with the EU service
and fills in the company name.
When the service needs credentials, the builder asks for them first. They are saved as Secrets, and you type them into a secure form. They never appear in the conversation or in the app.
What you see in Cloud → Procedures
- The list of procedures. Each one shows what it does, who may use it, and its last result.
- An on/off switch. A switched-off procedure cannot be called by the app.
- View script. Shows the code, for anyone curious or reviewing.
- Test. Runs the procedure once with sample input and shows the answer and any messages.
- Recent runs. Shows each run with its time, how long it took, and any error.
Who may use a procedure
A procedure can be open to everyone who can run the app, or only to the people who design it. The second option suits admin tools. When a procedure reads ERP.net data, it does so as the person using the app, on the instance they are working in.
Cache
Procedures and triggers can remember small things for a limited time. This is usually the sign-in token of another service, so the app doesn't sign in again on every click. Each item expires on its own, after at most 24 hours.
Cloud → Cache lists what is currently remembered. For each item you see its name, whether it belongs to one instance or all of them, its size, and when it expires. The contents are never shown, because they are often tokens. Press Clear on an item, or Clear all, to make the app sign in fresh on its next call. This is useful after you change a password.
Good to know
- The whole section has its own on/off switch at the top of Cloud → Procedures — switch it off to stop the app calling any procedure; each procedure still keeps its own switch.
- A procedure must finish within 15 seconds.
- It can call outside services only over secure (https) addresses. Internal network addresses are blocked.
- Procedures use the same simple script engine as triggers. The builder knows its limits.
- Run history is kept for 7 days.