# Create secure human-in-the-loop approval flows with Postgres: n8n workflow

> Started by another system calling it, and works across Postgres and Telegram. 21 steps, 5 branches: large, and worth reading before you trust it with...

Source: https://millionrounds.com/workflow/create-secure-human-in-the-loop-approval-flows-with-postgres (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Content](https://millionrounds.com/workflows?category=Content#library)

# Create secure human-in-the-loop approval flows with Postgres

Started by another system calling it, and works across Postgres and Telegram. 21 steps, 5 branches: large, and worth reading before you trust it with anything live.

Large

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fcreate-secure-human-in-the-loop-approval-flows-with-postgres)

**21 steps** Large: read it before trusting it with anything live

**5** Branches: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 1 Logic 6 Service 14

The steps in the order they run, from what starts it.

- 1 **01 Webhook Trigger: Approval Decision** Webhook *Starts it*
- 2 **02 FN: Verify Signature + TTL** Code *Logic*
- 3 **Actions** Switch *Logic*
- 4 **04c DB: Update Ticket Status** Postgres *Service*
- 5 **04r0 DB: Get Ticket ID** Postgres *Service*
- 6 **04e DB: Insert Audit Expired** Postgres *Service*
- 7 **04i DB: Insert Audit Invalid** Postgres *Service*
- 8 **04c2 DB: Insert Audit Row** Postgres *Service*
- 9 **Execute a SQL query1** Postgres *Service*
- 10 **05e Telegram: Notify Expired** Telegram *Service*
- 11 **05i Telegram: Alert Invalid** Telegram *Service*
- 12 **04c1 DB: Get Ticket Owner** Postgres *Service*
- 13 **Text (reject)** Telegram *Service*
- 14 **04c1a IF: Resolved or In Progress** If *Logic*
- 15 **05c Telegram: Update Confirmation** Telegram *Service*
- 16 **If Resolved** If *Logic*
- 17 **If in_progress** If *Logic*
- 18 **05c1a Telegram: Notify Resolved** Telegram *Service*
- 19 **05c1b Telegram: Notify In Progress** Telegram *Service*
- 20 **Notify Failed?** If *Logic*
- 21 **Execute a SQL query** Postgres *Service*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 21, with 5 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Postgres, Telegram
- **Model:** None. This is plumbing, not judgement

## Questions

What does it need to run?

An n8n account, plus your own Postgres and Telegram accounts. You connect your own accounts after importing it; none are included.

What starts it?

It starts on another system calling it.

Does it use AI?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Take your time. At 21 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 21 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fcreate-secure-human-in-the-loop-approval-flows-with-postgres)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Postgres](https://millionrounds.com/workflows?service=Postgres#library)[Telegram](https://millionrounds.com/workflows?service=Telegram#library)

## Workflows like it

Also content, with the same services where possible, closest in size first.

- [**Create photorealistic social media images with Flux Realism** 21 steps · Airtable, Telegram](https://millionrounds.com/workflow/create-photorealistic-social-media-images-with-flux-realism)
- [**Cross-post RSS feed articles to X, LinkedIn and Facebook** 21 steps · LinkedIn, Postgres](https://millionrounds.com/workflow/cross-post-rss-feed-articles-to-x-linkedin-and-facebook)
- [**Evaluate organizational data maturity and email HTML reports** 21 steps · Email, Postgres](https://millionrounds.com/workflow/evaluate-organizational-data-maturity-and-email-html-reports)
- [**Social media campaign manager with LinkedIn and Postgres** 21 steps · Email, LinkedIn](https://millionrounds.com/workflow/social-media-campaign-manager-with-linkedin-and-postgres)
- [**Articles into kids’ audiobooks and comics with Telegram** 21 steps · calls a model · Telegram](https://millionrounds.com/workflow/articles-into-kids-audiobooks-and-comics-with-telegram)
- [**Create AI product video ad Shorts from Telegram photos** 21 steps · calls a model · Telegram](https://millionrounds.com/workflow/create-ai-product-video-ad-shorts-from-telegram-photos)
