Skip to main content
Apragya AIFree quotation builderQuotation builderQuote builderno signup
Integration

Connect PostgreSQL to Apragya: Read and Write Your Own Database From Workflows

For developers and IT teams with data in their own PostgreSQL: pull it into workflows and write results back, without building and hosting a separate sync service.

An engineer fitting a key into a cabinet of small drawers in a parts warehouse

To connect PostgreSQL to Apragya, you create a database user with only the rights it needs, enter the host, port, database name and SSL mode, and test the connection. Workflows can then run queries, write rows and list tables.

Many Indian companies keep an in-house database: a dealer portal, a production logger or an older application. Getting that data next to orders and invoices usually means a nightly export someone has to watch.

This page covers the settings, safety rules, an illustrative example and how to reach a database that is not on the internet.

What nightly exports cost

Stale data

Decisions are made on yesterday's numbers.

Silent failures

A failed export is noticed days later.

Loose credentials

A superuser password sits in a script on a laptop.

Duplicate logic

The same mapping is rewritten for every new report.

An example: a Ludhiana tractor parts dealer network

Take an illustrative parts distributor whose dealer portal stores dealer orders in its own PostgreSQL database. Orders were exported to a spreadsheet each evening and entered again as sales orders.

Checks before the dealer database went live

  • Read-only userA user that can read only the orders view.Done
  • SSL requiredSSL mode set to require, not prefer.Done
  • Test connectionHost, port and credentials confirmed.Checked
  • Table listThe orders view appeared in the list.Matched
  • Write-back userStatus updates added in phase two.Pending
The write-back user waited until the read side had run cleanly for a month.

Dealer orders now arrive as sales orders within minutes, with no evening spreadsheet. The database user can read only the orders view, so a mistake in a workflow cannot touch anything else.

A cabinet with one open drawer and the rest locked
The dealer workflow can open one drawer: the orders view, and nothing else.

How the Postgres database connector works

Step 1 of 5

Add connection details

Host, port, database name, SSL mode and an optional default schema.

  1. Add connection details: Host, port, database name, SSL mode and an optional default schema.
  2. Add a limited user: Username and password, encrypted at rest.
  3. Test: The test opens a connection and reports the result.
  4. Query: Run SELECT queries with named parameters; results come back as rows.
  5. Write: Run INSERT, UPDATE or DELETE with parameters; the row count is returned.

Choosing a PostgreSQL integration

A sync service you host yourself needs servers, monitoring and someone to fix it. A connector inside the workflow keeps the logic with the business process and the credentials in one encrypted place.

Custom sync scripts, against Apragya

FeatureCustom sync scriptApragya PostgreSQL connector
HostingYour serverRuns with your workflows
ParametersOften string-built SQLParameterised only
SSLWhatever was setConfigurable, require recommended
Private databasesVPN or open portTenant Runner, outbound only
CredentialsIn a fileEncrypted at rest

Checked against public information on 16 September 2026.

What sets it apart

Parameterised queries

User values never go into the SQL text.

Managed or self-hosted

Works with PostgreSQL-compatible services and your own servers.

Behind your firewall

The Tenant Runner reaches it over an outbound connection.

Next to your records

Results feed orders, stock and ledgers directly.

Agents can use it

An agent can look up data before drafting its output.

Large results capped

Results are marked as truncated beyond the row limit.

Imported orders land in sales orders; for the wider options, compare API access in Apragya and Tally.

Getting started: connect ERP to Postgres safely

  1. Create a dedicated database user with read access to the views you need.
  2. Allow the connection through your firewall, or install the Tenant Runner inside the network.
  3. Enter the details with SSL mode set to require, and test.
  4. Build one workflow that reads and maps a small set of rows.
  5. Add write access only for the tables that need it.

Views are a good boundary: expose exactly the columns the workflow should see.

What it costs to start

Free
Up to 3 users
CRM, HR and Vendor Onboarding
INR 3,999
Starter, a month
Up to 10 users, CRM and HR plus a choice of apps
INR 7,999
Pro, a month
Up to 25 users and every enterprise app

Connecting PostgreSQL, answered

Does it work with managed PostgreSQL services?
Yes. It works with PostgreSQL-compatible databases, whether managed in the cloud or self-hosted.
Our database is not on the internet. Can we still connect?
Yes. Install the Tenant Runner inside your network. It makes an outbound connection, so no inbound firewall rule is needed.
Can a workflow drop a table?
Only if the database user is allowed to. Give the connection a limited user and that cannot happen.
What about MySQL or SQL Server?
The ready-made connector is for PostgreSQL. Other databases can be reached through an API you expose, or talk to us about your case.
What does it cost to start?
The free plan covers up to 3 users with CRM, HR and Vendor Onboarding and 1,000 AI Credits a month. Starter is INR 3,999 a month for up to 10 users, with CRM and HR plus a choice of apps such as Sales and POS, Inventory, Payroll, Purchase and Payables, Support and Manufacturing. Pro is INR 7,999 a month for up to 25 users with every enterprise app, including Finance and Accounting, plus 5,000 AI Credits, single sign-on and audit logs.

Bring your database into the workflow

Create a limited user, test the connection, and read your first rows.