⚙️ Workflow Automation

Turn "query → analyze → decide" into reusable flows. Run across databases, involve AI, and re-run anytime.

A concrete example

Generate a daily sales report while you sleep

🐘 PostgreSQLquery today's orders
🐬 MySQLjoin customer data
🤖 AIsummarize findings
📤 Reportexported & ready to share

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.

YAML Definition

One file, one flow

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.

  • Step types: query / ai / condition / foreach
  • Variables: string / number / connection, with defaults and required validation
  • Template syntax: single values, row sets, full table JSON all referenceable
  • Error strategies: abort / skip / fallback; configurable timeouts
Workflow window
Cross-Database Orchestration

One flow, multiple databases

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}}
Cross-database Workflow
Four Ways to Run

Run from anywhere

  • Connection window AI sidebar: select workflow, fill variables, view results
  • Standalone Workflow window: tabbed management for multiple flows, full-screen focus
  • External AI tools: list and run your flows from compatible external AI tools
  • AI generation: let AI generate an executable workflow from your requirements
Workflow execution

Typical scenarios

📦

Orders + Logistics

Query orders from PG, fetch logistics from MySQL, AI summarizes in one sentence — ready for support.

🔁

Loop Inspection

foreach over large orders, generate notes per row; condition handles empty result branches.

🛟

Graceful Fallback

When the primary table is missing, fallback to a backup query — flow continues with a notice row.

Scope note: current focus is query and AI orchestration (no standalone HTTP / script steps). Loops have sensible defaults to avoid runaway runs. Full syntax is in the user guide.