Docs »

Data Queries »

Custom Datasources

behavior.*

behavior.* data queries are created on the ‘Data Query Datasource’ event. The behavior can gather data as needed (e.g. external APIs, worklist results, etc).

The alias configured there (e.g. get_stock_price) can be specified as a data query type (e.g. type:behavior.get_stock_price).

Inputs

Any arguments provided in the query are provided to the behavior as input variables.

Response Formats

Responses are returned in JSON format. This makes it much simpler to request data from bot behaviors from dashboard widgets, other bot behaviors, or the API.

Examples

Fetch stock price data

Bots can create behaviors on the ‘Data Query Datasource’ event. This allows data from any source (e.g. external API) to be returned from a data query. Data query parameters are sent to the bot behavior as input variables, and data is returned from the ‘Return data’ action as JSON.

The data query would look like:


type:behavior.get_stock_price
symbol:AAPL

Which could be visualized as: