Logic Basics
Logic that you build in Xano is made up of several core components that you’ll see across the entire platform. Each primitive, or ‘thing you can build’ (like APIs, AI Agents, and more) has its own set of components it uses, but you’ll also find some overlap between them. For example, APIs, custom functions, and AI tools all use inputs, but background tasks don’t. However, those same primitives all have a stack which contains what will actually run when it’s time to do so.Inputs
Inputs are the data that the logic might need to perform its operation. They are declared in the input block of the primitives that support them. Inputs are optional, but the block must be declared even if empty.
Logic
What happens during execution. Your logic can be comprised of any combination of:FunctionsFilters
- Functions are individual pieces of logic, like getting a record from the database, or generating a random number.
Learn more about functions
- Filters are applied ‘inline’ to other values, and are used to transform or manipulate data, such as trimming whitespace or converting to uppercase.
Learn more about filters
Response
The response is what the logic will return when it’s executed. It can be a value, a message, a JSON object; almost anything you want. Responses can be returned from a variable, or manually defined in the response itself.
Variables
Variables are used to store data that can be reused throughout your logic. They are declared in the variable block of the primitives that support them. Variables are optional, but the block must be declared even if empty.
Environment Variables
Environment variables are persistent variables that are available across your entire workspace. Typically, these are used to store things like external API keys that you need to use across multiple function stacks.