Interact with Cortex Agentic Assistant agents to build and run XQL queries.
You can use natural language prompts to generate and run XQL queries through the Cortex Agentic Assistant chat. This allows you to access and analyze datasets without requiring prior knowledge of XQL syntax.
This capability is provided through two actions. The first is a built-in TextToXQL action available for all agents, that takes natural language prompts and translates them into XQL queries. The second is the Cortex - Run XQL Query action, which is included with all system agents and can be added to custom agents. If a custom agent does not have the Cortex - Run XQL Query action, it cannot execute XQL queries.
Action | Description |
|---|---|
TextToXQL | Translates your natural language request into a valid XQL query. This action is built-in to all agents. It does not display in the list of actions for an agent and it cannot be removed. NoteThe TextToXQL action is a hidden system action and does not appear in the Agents Hub. |
Cortex - Run XQL Query | Executes an XQL query and returns the data. |
Data access and permissions
The TextToXQL action is designed for system datasets. It cannot create XQL queries for custom datasets. You can manually write a query for custom datasets and ask the agent to run the query.
The TextToXQL action can generate XQL queries for datasets that you do not have permission to access, but the Cortex - Run XQL Query action can only execute if you have the necessary permissions for the dataset.
Best practices for prompting
We recommend using clear specific language to request that the agent create and execute XQL queries. Use terminology such as:
Create an XQL query to...
Build an XQL query for...
Generate an XQL query that...
You can have the agent automatically run the query or you can manually run it yourself.
Results
When a query runs, the agent provides a preview of the results and you can also see the full dataset by pivoting directly to the XQL page.
Note
Running XQL queries manually through an agent does not consume compute units. This includes scenarios where you prompt the agent to create and execute a multi-step plan.