Skip to content

Egress PostgreSQL

Responsibility

Parameterized SQL capability provider for workflow service_call steps.

Capabilities:

  • egress.postgres.query — read (SELECT / WITH / …) → { ok, row_count, rows }
  • egress.postgres.execute — DML/DDL (INSERT / UPDATE / …) → { ok, row_count }
  • postgres.connection — connection type postgres

Requests use parameterized SQL only:

{
  "sql": "SELECT item_json FROM erpnext_item_snapshot WHERE item_id = %s",
  "params": ["100002"]
}

Multiple statements in one call are rejected. Connection fields (host, port, database, username, password, sslmode) are merged from the workflow connection document.

Connection Model

name: postgres
type: postgres
host: postgres
port: 5432
database: meshflows
username: meshflows
password: $secret:postgres-password
sslmode: prefer

Reference: flows/connections/postgres.yaml.

Architecture

Capability provider (see Deploy integration contract):

  • Registers with capability-registry at startup as postgres.service
  • Distinct from the platform postgres Deployment (orchestrator ledger); this service is egress-postgres and talks to whatever DSN the connection specifies

Example workflow step

- id: load_snapshot
  type: service_call
  capability_name: egress.postgres.query
  capability_version: "^1.0"
  path: /query
  connection: postgres
  payload: |
    {
      "sql": "SELECT item_json FROM erpnext_item_snapshot WHERE item_id = %s",
      "params": ["{item_id}"]
    }
  values:
    item_id: "request:xml:/Message/id"