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.
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
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.
How the Postgres database connector works
Step 1 of 5
Add connection details
Host, port, database name, SSL mode and an optional default schema.
- Add connection details: Host, port, database name, SSL mode and an optional default schema.
- Add a limited user: Username and password, encrypted at rest.
- Test: The test opens a connection and reports the result.
- Query: Run SELECT queries with named parameters; results come back as rows.
- 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
| Feature | Custom sync script | Apragya PostgreSQL connector |
|---|---|---|
| Hosting | Your server | Runs with your workflows |
| Parameters | Often string-built SQL | Parameterised only |
| SSL | Whatever was set | Configurable, require recommended |
| Private databases | VPN or open port | Tenant Runner, outbound only |
| Credentials | In a file | Encrypted 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
- Create a dedicated database user with read access to the views you need.
- Allow the connection through your firewall, or install the Tenant Runner inside the network.
- Enter the details with SSL mode set to require, and test.
- Build one workflow that reads and maps a small set of rows.
- 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
Connecting PostgreSQL, answered
Does it work with managed PostgreSQL services?
Our database is not on the internet. Can we still connect?
Can a workflow drop a table?
What about MySQL or SQL Server?
What does it cost to start?
Bring your database into the workflow
Create a limited user, test the connection, and read your first rows.