Prerequisites
If you self‑host Sequin: If you use Sequin Cloud:Basic setup
Prepare an Elasticsearch cluster
Sequin converts Postgres rows to JSON documents and sends them to the Elasticsearch Bulk API. You need a reachable cluster:-
Local development ⇒ run Elasticsearch in Docker:
The script starts Elasticsearch + Kibana and prints connection details:Use the API key (not the user/password) when configuring the sink.
- Production ⇒ Elastic Cloud or self‑managed cluster.
Map Postgres tables to Elasticsearch indices
Elasticsearch stores documents in indices. As a rule of thumb create one sink per Postgres table → one index. That keeps the mapping consistent and simplifies queries. Advanced scenarios – sharding, multi‑tenancy, or routing documents to multiple indices – can be handled with filters and soon with Sequin Routing functions.Create an Elasticsearch sink
Navigate to Sinks → Create sink → Elasticsearch and follow the steps below.1
Source configuration
Under Source pick the table or schema you want to index in Elasticsearch.Optionally:
- Select which actions (
insert,update,delete) you care about. - Add filters such as
in_stock = trueto index only a subset of rows.
2
Backfill existing rows
Enable Initial backfill if you want Sequin to load existing rows into Elasticsearch before streaming live changes.
3
Transform rows to documents
Your transform must emit JSON compatible with the index mapping.
Sequin automatically builds the document For dynamic schemas you can just return
_id from the table’s primary key. Let us know if you need to use a different _id field.Typical transform:record unchanged.
See the Elasticsearch ingest best‑practices for mapping guidance.4
Delivery settings
In the Elasticsearch card enter:
- Endpoint URL:
http://host.docker.internal:9200(or your cluster URL) - Index name:
products - Authentication type:
api_key - Authentication value:
<api-key>
5
Create the sink
Name the sink (e.g.
products-elasticsearch) and click Create sink. Sequin queues a backfill (if selected) and then starts streaming live changes.Verify & debug
- In Sequin’s web console watch the Messages count increase.
-
Query Elasticsearch:
-
If documents are missing:
- Check the Messages tab for failed deliveries.
- Inspect the error returned by Elasticsearch; mapping conflicts and authentication issues are common.

