---
title: Deploy Sequin with AI on Blossom
url: "/deploy/sequin/"
canonical_url: https://blossom88.com/deploy/sequin/
markdown_url: https://blossom88.com/deploy/sequin.md
summary: Stream changes from a PostgreSQL table and acknowledge them from a private
  Sequin Stream.
categories:
- deployment
- databases
stack:
- Elixir
- PostgreSQL
- Redis
---

# Deploy Sequin with AI on Blossom

[Sequin](https://github.com/sequinstream/sequin) reads changes from
PostgreSQL and sends them to a stream, webhook, or queue. Start with
one orders table and acknowledge each change through the Stream API.

## Ask Your Agent

> **Ask your AI agent:** Deploy Sequin on Blossom and help me stream changes from a sample orders table.
>
> Follow this guide: https://blossom88.com/deploy/sequin/

[Install the Blossom CLI and skill](https://docs.blossom88.com/learn/getting-started/install/) on your agent's machine and [choose a Location in your cloud account](https://docs.blossom88.com/learn/getting-started/choose-your-cloud/#connect-your-provider).

## Have Ready

- **PostgreSQL with logical replication** (Required): Try the isolated sample database first. To use your own source, have a replication role, publication, and slot ready.

## How It Runs

| Part | Role | Where |
|---|---|---|
| Sequin | Read PostgreSQL changes and serve the stream API | Private Service on App Capacity |
| PostgreSQL | Keep Sequin state and the sample orders in separate databases | Private Persistent Service |
| Redis | Coordinate the stream and its workers | Managed Redis |
| Consumer | Pull and acknowledge sample changes | Blossom Job |

## Deploy Sequin

Use the [self-hosted Sequin image](https://sequinstream.com/docs/running-sequin)
behind a private endpoint. Connect durable Redis and keep Sequin's state
database separate from the [replication source](https://sequinstream.com/docs/reference/databases).

<details class="optional-reading" markdown="1">
<summary>Notes for your agent</summary>

Mount the PostgreSQL Volume at `/var/lib/postgresql/data`.
Enable logical WAL on the new sample PostgreSQL instance. Create a
publication for the orders table and a replication slot. Use separate
database logins for Sequin state, replication, and sample writes.
Map the private Managed Redis URL to database 1 for the standalone
Redis client in Sequin 0.14.6. Keep the Sequin vault key stable.
Configure an authenticated Sequin Stream for inserts and updates.

    blossom environment:deploy --id environment-100 --follow

</details>

## Read a New Order

Insert a pending order. Pull the change from the stream and
acknowledge it so the consumer is ready for the next event.

> **Ask your AI agent:** Help me insert a sample order, read it from the Sequin Stream, and acknowledge it.

> Follow this guide: https://blossom88.com/deploy/sequin/



![Acknowledge a new pending order from the stream.](/deploy/assets/images/sequin/order-insert-in-stream.webp)

## Continue Streaming After an Update

Replace the Sequin Container, then mark the same order shipped.
Read the update from the existing stream and acknowledge it.

> **Ask your AI agent:** Replace the Sequin Container and check that the same stream picks up an update to my order.

> Follow this guide: https://blossom88.com/deploy/sequin/



![Read the shipped update from the same stream after replacement.](/deploy/assets/images/sequin/order-update-after-replacement.webp)

## What You Get

A private PostgreSQL change stream that stays ready to process
new events after an app update.

## What You Get

- A private Sequin Stream and a test consumer
- Acknowledged insert and update events from one PostgreSQL table
- The same stream after replacing the Sequin Container

Tested on Blossom: The same stream acknowledged new PostgreSQL changes before and after replacing Sequin.
