Skip to content

Data

Last updated

Database Automation

Read from and write to your own MySQL, PostgreSQL and MongoDB databases. Use one SQL_QUERY node for a parameterized statement, or the record nodes for find, insert, update, delete, aggregation, transactions and bulk operations.

No credit card required

Free plan available

Cancel anytime

How It Works

Get started in minutes

1

Save a database credential

Add the host, port, user, password and database name as a credential in your workspace, or paste a postgres:// or mysql:// connection string into the SQL node. The database must be reachable from the internet.

2

Run a query

Use SQL_QUERY for a single parameterized SQL statement, or connect with DB_CONNECT and use the record nodes (find, insert, update, delete, distinct, aggregate).

3

Use the rows

Results are stored in a variable. Pass them to data processing nodes, Google Sheets, Slack, a report, or the next query.

4

Automate it

Run the workflow on a schedule, from a webhook, or through the API, so the database stays in sync without manual exports.

Connect your database to your automations

Most automations end with data that needs to go somewhere. Autonoly has database nodes for MySQL, PostgreSQL and MongoDB, so a workflow can write scraped or processed data straight into your tables, or read records to drive the next steps.

Runs happen in Autonoly's cloud, so the database has to accept connections from the internet. A database that only listens on a private network or localhost cannot be reached. If you can only open SSH to your server, you can use the SSH nodes to run a command-line client there instead.

The quick path: SQL_QUERY

SQL_QUERY runs one SQL statement against PostgreSQL or MySQL and returns the rows. It is the node the AI agent uses when you ask it to read or write a SQL database.

  • Dialect: postgres (default) or mysql.

  • Connection: a saved credential with host, port, user, password, database and optional SSL, or a connection string.

  • Parameters: use $1, $2 placeholders for PostgreSQL or ? for MySQL and pass the values as a params array. Values are never pasted into the query text.

  • One statement per node. Multiple statements in one query are rejected.

  • Results: rows, rowCount, fields and a truncated flag. Results are capped at 5,000 rows, so page through larger tables with LIMIT and OFFSET.

Example: after the agent scrapes a product list, it can insert each row with INSERT INTO products (name, price, url) VALUES ($1, $2, $3).

The record nodes

For finer control in the workflow builder, use a connection-based set of nodes. Open a connection once with DB_CONNECT (MongoDB, PostgreSQL or MySQL; optional connection check), then reference it by name.

NodeWhat it does
DB_CONNECT / DB_DISCONNECTOpen or close a named connection
DB_USE_DATABASESwitch database or schema on that connection
FIND_RECORDSQuery with a filter, projection, sort and limit
INSERT_RECORDSInsert one or more records
UPDATE_RECORDSUpdate matching records, with optional upsert
DELETE_RECORDSDelete matching records. Requires you to type the confirm phrase DELETE
DISTINCT_RECORDSReturn the distinct values of a field
AGGREGATE_RECORDSRun a MongoDB aggregation pipeline (MongoDB only)
DB_TRANSACTIONRun several find/insert/update/delete steps in one transaction
DB_BULK_OPERATIONSBulk insert, update or delete
DB_INDEXCreate, list or drop indexes
DB_EXECUTE_SCRIPTRun a script, a raw command, or a stored procedure

A few details worth knowing:

  • Transactions take an isolation level (read uncommitted, read committed, repeatable read or serializable), a timeout and a retry count.

  • Aggregation pipelines are MongoDB only. For SQL databases, use SQL_QUERY with GROUP BY, or group the rows afterwards with the data processing nodes.

  • Deletes are guarded. DELETE_RECORDS will not run unless the confirm phrase is set to DELETE. Always add a filter.

Common patterns

Scrape to database. The agent extracts listings with data extraction, cleans them, and inserts them with SQL_QUERY. Convert the chat into a workflow and schedule it to keep the table current.

Database to report. Query yesterday's orders, group them by product, and write the result to Google Sheets or a PDF report, then post a summary to Slack.

Database to web form. Read rows that still need processing, have the browser enter each one into a web app that has no API, then update the row's status.

Sync between systems. Read from MongoDB, map the fields, and upsert into PostgreSQL, all in one workflow with error handling around each step.

Capabilities

Everything in Database

Powerful tools that work together to automate your workflows end-to-end.

01

Parameterized SQL in one node

SQL_QUERY runs a single PostgreSQL or MySQL statement with safe placeholders.

PostgreSQL ($1, $2) and MySQL (?) placeholders

Saved credential or connection string

Optional SSL on the credential

Returns rows, row count and fields, capped at 5,000 rows

02

Record operations

Find, insert, update, delete and distinct nodes that work on a named connection.

Filters, projections, sort and limit on find

Upsert on update

Delete requires an explicit DELETE confirmation

Works with MongoDB, PostgreSQL and MySQL connections

03

Transactions and bulk writes

Group several writes so they succeed or fail together, or write many records at once.

Four isolation levels, timeout and retry count

Bulk insert, update and delete

Index create, list and drop

04

MongoDB aggregation and scripts

Run aggregation pipelines and raw commands against MongoDB, or scripts and stored procedures.

Aggregation pipelines (MongoDB only)

Raw JSON commands

Script and stored procedure modes

05

Works with the AI agent

Ask the agent in plain language to save results to a table or read records to work from.

The agent writes the SQL and passes values as parameters

Every query is recorded and can become a workflow step

Use Cases

What You Can Build

Real-world automations people build with Database every day.

01

Save scraped prices to PostgreSQL

Extract product names and prices from competitor pages every day and insert them into a prices table to build a history.

02

Daily sales summary

Query MySQL for yesterday's orders, group by product, and send the summary to Slack or a Google Sheet.

03

Enter database rows into a web app

Read pending records, have the browser fill a web form for each, then mark the record as done with an UPDATE.

04

Copy records between MongoDB and SQL

Find documents in MongoDB, reshape the fields, and write them to PostgreSQL in a transaction.

FAQ

Common Questions

Everything you need to know about Database.

Related automations, integrations and terms

Where this feature is used in practice.

DefinitionAI AgentAn AI agent is an autonomous software system that uses large language models to perceive its environment, make decisions, and take actions to accomplish goals with minimal human direction.DefinitionApifyApify is a cloud platform for web scraping and browser automation, founded in Prague in 2015, where scrapers run as containerized 'Actors' and thousands of ready-made Actors are available in the Apify Store; it also maintains the open-source Crawlee library.DefinitionData ScrapingData scraping is the broad practice of programmatically extracting data from any digital source — websites, applications, databases, documents, or APIs. It encompasses web scraping, screen scraping, and other automated extraction techniques.IntegrationGoogle Sheets integrationRead ranges, append or overwrite rows, create spreadsheets, and start a workflow for every new row added to a Google Sheet.DefinitionIMPORTHTMLIMPORTHTML is a Google Sheets function that imports a whole HTML table or list from a web page into your spreadsheet, chosen by its position on the page. It is the quickest way to pull a static table into Sheets, and it shares IMPORTXML's limits: no JavaScript, no logins, hourly refresh.TemplateLinkedIn Company Page Scraper AI AgentAutomatically extract comprehensive company information from LinkedIn company pages with this intelligent AI Agent workflow. This template…TemplateCB Insights Unicorn Company Data Scraper AI AgentAutomate CB Insights unicorn company data extraction with Autonoly's AI Agent. Extract 1,258+ billion-dollar startups, valuations,…GuideDatabase Automation for People Who Don't Know What Databases AreLearn database automation in plain English. No technical jargon, no coding required. Discover how to automate your data without…

Ready to try Database?

Start automating your work with Autonoly. Start free, no credit card required.

No credit card

Free plan available

Cancel anytime