SQL Bot
The sql_bot workflow provides a natural-language interface to the OMD Powerhouse StarRocks database. Users can ask questions in plain language and the agent generates and executes the appropriate SQL query, returning the results in a readable format.
Workflow ID
sql_bot
Parameters
No specific workflow_data is required. The workflow is fully interactive.
Example
{
"user_ids": ["@analyst:optimizemyday.ai"],
"workflow_id": "sql_bot",
"workflow_data": {},
"config_id": "16169276",
"instance": "www",
"channel": "matrix",
"language": "en",
"new_room": true
}
How it works
- The agent greets the user and asks for their question.
- The full StarRocks database schema (table names, column names, data types) for the relevant OMD instance is injected into the system prompt.
- The LLM translates the user's question into a SQL query.
- The agent executes the query against StarRocks and returns the results.
- The conversation continues — the user can ask follow-up questions or request different aggregations.
What data is accessible
The SQL bot has access to the analytical data in OMD Powerhouse, including:
- Workforce analytics (task completion rates, time-on-site, travel time)
- Historical trip and visit data
- Territory and resource performance metrics
- Custom tables loaded into the Powerhouse data lake
Data privacy note
When this workflow is active, the full StarRocks schema is sent to the LLM provider as part of the system prompt. Query results are also sent to the LLM for formatting. Refer to the Privacy & Data page for details.
Security
The SQL bot executes queries using a read-only database role. Write operations are not possible.