Skip to content

Xano request action

When you add the Xano data source plugin to a WeWeb project, it unlocks the Xano Request action in workflows.

Request action

The Xano Request action in workflows allows you to make requests to the endpoints of the Xano instance you configured in WeWeb's Xano data source plugin:

Xano request example

In the example above, you can see that we are configuring a call to:

  • the POST poems endpoint,
  • in the library API group of our Xano instance.

This endpoint includes 3 inputs – poem, title, and author – which I bound to input variables from my WeWeb project.

As a result, the values I send to Xano will vary based on the values in my WeWeb variables.

Using component variables

The Xano Request action can access variables from WeWeb components, making it particularly useful for interactive features like AI chat components, dynamic forms, and real-time applications.

Accessing component data

When configuring your Xano request, you can bind endpoint inputs to:

  • Page variables: Global variables available throughout the page
  • App variables: Variables accessible across your entire application
  • Component variables: Variables specific to individual components on your page

Component variables are especially valuable for:

AI chat implementations: Bind user input from chat components directly to AI endpoints ✅ Dynamic forms: Use form component data to update records in real-time ✅ Interactive elements: Connect component states to backend operations ✅ Real-time updates: Stream component data to Xano for live processing

Example: AI chat component

For an AI chat component, you might have:

  • A messageInput component variable containing the user's current message
  • A conversationHistory component variable storing previous messages
  • A streamResponse component variable for receiving AI responses

You can bind these component variables directly to your Xano AI endpoint inputs, enabling seamless communication between your frontend components and backend AI processing.

TIP

Component variables are automatically available when configuring Xano requests. Simply select the component variable from the binding menu when setting up your endpoint inputs.

Streaming

A streaming response in Xano is a method of data transfer where information is sent and processed in chunks, rather than all at once. In the context of APIs, it means sending parts of the response to the client as they become available, instead of waiting for the entire response to be ready before sending anything.

Common use cases include:

  • AI chatbots.
  • Large datasets.
  • Real-time updates.
  • Long-running operations.
  • Improve perceived performance.

When not to use streaming:

  • small responses.
  • Client limitations.
  • Simple CRUD operations.
  • Atomic operations (when the entire operation needs to succeed or fail as a unit, streaming partial results might not be appropriate).

Pre-requisites

To work with a streaming response from Xano in WeWeb, you will first need to create a streaming API endpoint in Xano.

To set up your streaming API endpoint in Xano, we strongly recommend that you watch their video on “Streaming API Responses with Xano“:

Request settings in WeWeb

To receive a streaming response from Xano in WeWeb, you'll need to trigger a standard Xano Request action in a workflow and ensure two things:

  1. The option Stream response is enabled.
  2. You've selected an array variable in your project where you wish to store the streaming response.

Streaming request to Xano

When we test the action, we can see our stream variable being updated line by line:

Streaming a response from Xano

This is because, in Xano, our variable was an array of lines. When we looped through the variable, each item was a line:

Streaming request to Xano

If we wanted to stream the response character by character, we would need to change the function stack of our Xano endpoint so each item is a character.

In the example below, instead of having an array variable in Xano formatted as a raw JSON, we have a strong variable and applied a split function to return the text as an array of character:

Streaming request to Xano, response by character

Here's what it would look like in action:

Streaming request to Xano, response by character