Skip to main content
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. Not all primitives support responses; see below.
PrimitiveSupports ResponseNotes
APIYesReturns the JSON object defined in the response block
AI AgentNoYour agent will return messages to the user, but you don’t directly define the response like other primitives
TriggerYesReturns the JSON object defined in the response block
Background TaskNoNo responses are supported
Custom FunctionYesReturns the JSON object defined in the response block
MiddlewareYesReturns the JSON object defined in the response block
AI ToolYesReturns the JSON object defined in the response block
MCP ServerNoYour tools will deliver messages back to the MCP client, but you don’t directly define a response like other primitives

Adding a Response

Responses will usually come from a variable of some kind, but you can also manually define a static value, or use filters to create a combination of both. When building visually, Xano will automatically add a response of the first variable in the stack. For example, if you start by adding a Query All Records function, Xano will make sure that the response is the output of that function. Responses can be returned as self, meaning that it is not nested in another object.
Example of a self response
{
  "id": 1,
  "created_at": 1760368044972,
  "name": "Erin Porter",
  "email": "mei.payne@google.com"
}
You can also return each response as its own nested object.
Example of a nested response
{
  "user": {
    "id": 1,
    "created_at": 1760368044972,
    "name": "Erin Porter",
    "email": "mei.payne@google.com"
  }
}
  • Visually: Canvas View
  • Visually: Function Stack
  • XanoScript
Find your response block and choose Add a Response.
response-20251013-135205
Give your response a name, and choose whether you want to return it as self or nested under another value.
response-20251013-135552
I