Skip to contentNewLaunching soon on Product Hunt (opens in a new tab)
FunctionsAll sections

Functions

Functions run your own code on Backenly’s servers instead of in the user’s browser. A function runs when something happens: a user signs up, a row changes, a schedule comes round, or your app calls its HTTP endpoint.

In the console: Build › FunctionsUpdated October 12, 2026

Walkthrough coming soonA 20-second tour of Functions will play here.

Why you need it

Some work cannot run in the browser. A Stripe secret key or an email API key would be visible to anyone who opens the developer tools, and a browser tab cannot run a job at 3 a.m. or react when another user changes a row. Functions are where that code goes. It runs on the server, reads secrets your app never sees, and starts on its own when its trigger fires.

For example

  • Send a welcome email when a user signs up.
  • When an order is inserted, charge the card and record the payment.
  • Every night, delete carts that were abandoned more than 30 days ago.
  • Check a coupon code against rules your frontend should not be able to read.

How it works

  1. Your agent writes the function

    From a description, or from your own source code. A function whose code does not compile and load is never saved.

  2. You choose what starts it

    A user signing up; an insert, update or delete on a table; a schedule (every 15 minutes, or a 5-field cron expression); an HTTP request to /api/v1/{projectId}/fn/{name}; or only when you run it by hand.

  3. It runs on the server

    It can read encrypted environment variables you set for the project, so secret keys never reach the browser.

  4. Every run is logged

    The console shows each run with its result, duration, log lines and error. You can test-run a function from the console before relying on it.

Try it

Once your coding agent is connected, ask it:

Ask your agent
When a user signs up, send them a welcome email through Resend.
Ask your agent
Every night at 2:00, delete carts older than 30 days that never became orders.

Good to know

  • Runs are counted per month, and the allowance depends on your plan. See Pricing.
  • Turning a function off stops its trigger without deleting it. Deleting one from your agent waits for a person to approve it.
  • There are no SQL functions (rpc()). Logic that would live in a stored procedure runs here instead.