Xano Documentation
  • 👋Welcome to Xano!
  • 🌟Frequently Asked Questions
  • 🔐Security & Compliance (Trust Center)
  • 🙏Feature Requests
  • 💔Known Issues
  • Before You Begin
    • Using These Docs
    • Where should I start?
    • Set Up a Free Xano Account
    • Key Concepts
    • The Development Life Cycle
    • Navigating Xano
    • Plans & Pricing
  • The Database
    • Designing your Database
    • Database Basics
      • Using the Xano Database
      • Field Types
      • Relationships
      • Database Views
      • Export and Sharing
      • Data Sources
    • Migrating your Data
      • Airtable to Xano
      • Supabase to Xano
      • CSV Import & Export
    • Database Performance and Maintenance
      • Storage
      • Indexing
      • Maintenance
      • Schema Versioning
  • 🛠️The Function Stack
    • Building with Visual Development
      • APIs
        • Swagger (OpenAPI Documentation)
      • Custom Functions
        • Async Functions
      • Background Tasks
      • Triggers
      • Middleware
      • Configuring Expressions
      • Working with Data
    • Functions
      • AI Tools
      • Database Requests
        • Query All Records
          • External Filtering Examples
        • Get Record
        • Add Record
        • Edit Record
        • Add or Edit Record
        • Patch Record
        • Delete Record
        • Bulk Operations
        • Database Transaction
        • External Database Query
        • Direct Database Query
        • Get Database Schema
      • Data Manipulation
        • Create Variable
        • Update Variable
        • Conditional
        • Switch
        • Loops
        • Math
        • Arrays
        • Objects
        • Text
      • Security
      • APIs & Lambdas
        • Realtime Functions
        • External API Request
        • Lambda Functions
      • Data Caching (Redis)
      • Custom Functions
      • Utility Functions
      • File Storage
      • Cloud Services
    • Filters
      • Manipulation
      • Math
      • Timestamp
      • Text
      • Array
      • Transform
      • Conversion
      • Comparison
      • Security
    • Data Types
      • Text
      • Expression
      • Array
      • Object
      • Integer
      • Decimal
      • Boolean
      • Timestamp
      • Null
    • Environment Variables
    • Additional Features
      • Response Caching
  • Testing and Debugging
    • Testing and Debugging Function Stacks
    • Unit Tests
    • Test Suites
  • CI/CD
  • File Storage
    • File Storage in Xano
    • Private File Storage
  • Realtime
    • Realtime in Xano
    • Channel Permissions
    • Realtime in Webflow
  • Maintenance, Monitoring, and Logging
    • Statement Explorer
    • Request History
    • Instance Dashboard
      • Memory Usage
  • Building Backend Features
    • User Authentication & User Data
      • Separating User Data
      • Restricting Access (RBAC)
      • OAuth (SSO)
    • Webhooks
    • Messaging
    • Emails
    • Custom Report Generation
    • Fuzzy Search
    • Chatbots
  • Xano Features
    • Snippets
    • Instance Settings
      • Release Track Preferences
      • Static IP (Outgoing)
      • Change Server Region
      • Direct Database Connector
      • Backup and Restore
      • Security Policy
    • Advanced Back-end Features
      • Xano Link
      • Developer API (Deprecated)
    • Metadata API
      • Master Metadata API
      • Tables and Schema
      • Content
      • Search
      • File
      • Request History
      • Workspace Import and Export
      • Token Scopes Reference
  • Xano AI
    • Building a Backend Using AI
    • Get Started Assistant
    • AI Database Assistant
    • AI Lambda Assistant
    • AI SQL Assistant
    • API Request Assistant
    • Template Engine
    • Streaming APIs
  • AI Tools
    • MCP Servers
      • Connecting Clients
      • MCP Functions
  • Xano Transform
    • Using Xano Transform
  • Xano Actions
    • What are Actions?
    • Browse Actions
  • Team Collaboration
    • Realtime Collaboration
    • Managing Team Members
    • Branching & Merging
    • Role-based Access Control (RBAC)
  • Agencies
    • Xano for Agencies
    • Agency Features
      • Agency Dashboard
      • Client Invite
      • Transfer Ownership
      • Agency Profile
      • Commission
      • Private Marketplace
  • Enterprise
    • Xano for Enterprise
    • Enterprise Features
      • Microservices
      • Tenant Center
      • Compliance Center
      • Security Policy
      • Instance Activity
      • Deployment
      • RBAC (Role-based Access Control)
      • Xano Link
  • Your Xano Account
    • Account Page
    • Billing
    • Referrals & Commissions
  • Troubleshooting & Support
    • Error Reference
    • Troubleshooting Performance
      • When a single workflow feels slow
      • When everything feels slow
      • RAM Usage
      • Function Stack Performance
    • Getting Help
      • Granting Access
      • Community Code of Conduct
      • Community Content Modification Policy
  • Special Pricing
    • Students & Education
    • Non-Profits
  • Security
    • Best Practices
Powered by GitBook
On this page
  • What is a custom function?
  • Building and Using Custom Functions
  • Creating Custom Functions from Existing Function Stacks
  • Custom Function Settings
  • From the Settings panel

Was this helpful?

  1. The Function Stack
  2. Building with Visual Development

Custom Functions

Build business logic once and reuse it in multiple places

Last updated 3 months ago

Was this helpful?

Quick Summary

Custom functions are very similar to your APIs — they have inputs, a function stack, and a response. However, they can not be called externally. Instead, custom functions allow you to build something and use it in other places, while maintaining it in a centralized location.

What is a custom function?

Custom functions can be thought of as a building block for the rest of your backend. You can build a custom function just like an API endpoint, and insert that custom function into other function stacks, giving you easily reusable logic while only having to maintain it in one place. When you make a change inside of a custom function, that change is automatically in effect everywhere you have chosen to use the custom function.


Building and Using Custom Functions

1

Access your custom functions from the left-hand menu.

2

Click to create a new custom function.

Give your custom function a name, description, tags, and choose your settings.

When you're done, click .

3

Build your custom function

A custom function has three sections — the same as an API endpoint.

4

Insert your new custom function into other function stacks.

When you're ready to use your new custom function in other function stacks, click , choose Custom Functions from the panel that opens, and select your custom function.

You'll be able to supply data for any inputs the custom function is expecting here.


Creating Custom Functions from Existing Function Stacks

If you have a function stack that you'd like to convert into a custom function, you can do so in one of the following ways.

1

Convert the entire stack

Click the three dots in the upper-right corner and choose Convert To Function

2

Select individual steps to convert to a function

You can select a group of steps and click to convert those steps into a custom function.


Custom Function Settings

From the Settings panel

Name
Purpose

Name

The name of the custom function.

Description

An internal description, just for you.

Tags

Use tags to organize objects throughout your Xano workspace and find them later

Request History

  • Inherit Settings

    • Use whatever is set in your workspace branch defaults

  • Other

    • Set specific request history settings for this function

Response caching

Cache the response and redeliver it during future runs

🛠️
📖
Learn more about request history
📖
Learn more about response caching
request history

🔄 Function stack

This is where all of the magic happens. All of the business logic that is performed lives here.

As you add functions to your function stack, it will suggest next steps based on most popular user activity.

⬆️ Response

Once the function stack has done its job, it needs to know what to return. This lives in the Response section.

⬇️ Inputs

The inputs are anything that a function stack needs to run. For example, a function stack that logs in a user probably needs a username or email and a password; these would be the inputs.