Build a backend by telling the AI
Last updated: July 17, 2026
Sometimes a single button in your app or on your website has to do several things on the server. For example: check whether a member has enough points, deduct the points if they do, record the transaction, and return the result. This kind of work cannot be left to the screen. That is because, if the calculation that deducts points runs on the customer's screen, the values could be tampered with. Normally, you would have to build a separate server program (a backend) to do this work.
With WEEGLOO, you do not have to build this backend action yourself. Tell the agent what this button should do on the server, and it creates a backend action (Script) that the screen can call. The screen only has to call that action, and it gets the result back right away.
Tell your AI like this
Build a feature where members redeem points for a product. When the redeem button is pressed, check whether that member has at least as many points as the product's price. If they have enough, deduct the points, record the redemption, then return "Redemption complete" along with their remaining points. If they don't, tell them "You don't have enough points."
What the AI then does
- It creates the data structures to hold members' points and their redemption history.
- It creates a backend action (Script) called "Points Redemption". This action checks the member's points; if there are enough, it deducts the points, records the redemption, and returns the remaining points; if there are not enough, it responds that the points are insufficient.
- It connects the redeem button in your app or on your website so that it calls this action.
Deducting the points and recording the history all happen on the backend. Because the values cannot be tampered with from the screen, this is safe.
Check that it worked
Try pressing the redeem button as a member who has enough points. If their points go down and "Redemption complete" appears, it is working. If you press it as a member who does not have enough points, you should see the "You don't have enough points" message.
What to do next
- Script: covers what the backend action (Script) you created is, what it looks like, and how it runs.
- Connect your AI tool: To talk to the agent as shown above, you first need to connect the AI tool you use to WEEGLOO. Covers how to do that.
