Turn "query → analyze → decide" into reusable flows. Run across databases, involve AI, and re-run anytime.
Define it once in YAML or let AI generate it for you — then run it from the app, the chat sidebar, or an external agent via MCP.
Workflows are described in YAML: variables, steps, output. Steps pass data via
{{...}} templates — query results feed directly into AI, and AI conclusions
drive the next step.
query / ai / condition /
foreach
Each step can bind to a different connection and database. For example: query orders from PostgreSQL, fetch logistics from MySQL, then let AI summarize into a report.
steps:
- type: query
id: get_orders
connection: "{{pg_conn}}"
sql: |
SELECT order_id, amount FROM test_orders
WHERE uid = '{{uid}}'
- type: condition
id: check_orders
if: "steps.get_orders.rows_count > 0"
then_steps:
- type: query
id: get_logistics
connection: "{{mysql_conn}}"
sql: |
SELECT carrier, tracking_no, status
FROM test_logistics
WHERE order_id IN ({{steps.get_orders.rows.*.order_id}})
output:
format: markdown
template: |
## Orders & logistics for user {{uid}}
{{steps.get_orders.result}}
{{steps.get_logistics.result}}
Query orders from PG, fetch logistics from MySQL, AI summarizes in one sentence — ready for support.
foreach over large orders, generate notes per row; condition handles empty result branches.
When the primary table is missing, fallback to a backup query — flow continues with a notice row.