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 Workflow Testing?
  • How do I build workflow tests?
  • Using Workflow Tests
  • Databases in Workflow Tests

Was this helpful?

  1. Testing and Debugging

Test Suites

Last updated 23 days ago

Was this helpful?

Workflow Testing allows you to create sets of different tests to validate user flows are working as expected.

What is Workflow Testing?

Workflow Testing in Xano allows you to quickly build sets of tests that you can use to make sure a specific flow is working as expected. You can think of a 'flow' as a set of separate actions, such as multiple APIs that a user might hit when utilizing your application, or data processing across multiple function stacks.

Workflow Testing allows you to validate these sets or flows with a single click and get instant visibility into your backend functionality.

How do I build workflow tests?

From the left-hand navigation menu, choose Library > Workflow Tests

Choose Add Workflow Test in the top-right corner. In the panel that opens, you can give your test a name, description, and add tags for easy access later.

Click the button to add a step to your Workflow Test. We've introduced some new functions to assist you in building your tests.

Run Stacks

Run stacks are functions you can add to your workflow tests to run other function stacks, such as APIs, custom functions, and middleware.

Function Name
Use Case

Run API Endpoint

Sends a request to one of your API endpoints and returns the result

Run Addon

Runs an addon

Run Function

Runs a custom function and returns the result

Run Middleware

Runs a middleware and returns the result

Run Trigger

Runs a trigger and returns the result

Run Task

Runs a background task and returns the result

Test Expressions

Test Expressions are functions used typically in conjunction with a Run Stack to determine if the output of a Run Stack is valid.

Function Name
Use Case

Expect a variable to be defined Expect a variable to not be defined

Checks to see if a variable has been defined. Example: You have an API that returns a user object with a name key inside of it. You can use this to check if user.name is defined.

Expect variable to be empty

Checks to see if a variable exists, but is empty. Example: You are calling an external API that is used to process data. If the API call is successful, you know that response.result is empty because the API just returns a status code informing you that the job is being processed.

Expect variable to be false Expect variable to be true

Checks to see if a variable with a boolean data type is returning false or true

Expect variable to be greater than Expect variable to be less than Expect variable to equal Expect a variable to not equal Expect variable to be within

Checks to see if a variable matches the specific condition, such as >, <, =, or is within a certain range.

Expect variable to be null

Checks to see if a variable contains a null value

Expect variable to start with Expect variable to end with

Checks to see if the value inside of a variable starts or ends with a specific value

Expect function to throw

Checks a function to see if it throws an error

Expect function to match

Using Workflow Tests

In this example, we've built a workflow test to make sure our login flow works as expected.

We've added a Run Stack function to run our auth/login endpoint, and provided it with a username and password.

If we modify our Run API Endpoint run stack to provide an invalid password, we can see that by running our test again, we get an error. This test has failed because an authToken was not returned.

We can see by running all of our workflow tests the following information:

  • We have 38% coverage. This means that out of all of the function stacks that exist across our backend, 3/8 of them are used in our tests.

  • We have 50% success. This means that out of all of our workflow tests, half of them are successful.

  • To run all of our tests takes less than a second.

Additional Information

  • When you test a function stack that currently is in draft mode, your workflow test will run the drafted version.

Databases in Workflow Tests

When you select a data source for your Workflow Test, it's important to note that a copy of the database is generated to ensure that no live data is impacted. This usually means that selecting your live database is not recommended — if your database is large in size, this can cause complications during testing.

It is recommended to use separate Data Sources for running tests.

Checks to see if the output of a variable matches a

After that, our Test Expression checks to make sure that the login function is returning an authToken, which is what our login endpoint returns if a valid username and password is provided. When we click we can see that our test passes!

From the main Workflow Tests page, we can run each of our tests by clicking the individual buttons, or we can click to run all of our workflow tests at once.

Click the icon next to a workflow test to clone or delete it.

When adding a Run Stack, you can click the icon to open that function stack being tested in a new window or tab and quickly make changes.

You can change the data source that all of your workflow test's functions run against by clicking the button at the top of the workflow test function stack.

regular expression
Selecting a Data Source for a Workflow Test