Pavan
Dongare

Building systems at the intersection of product thinking and technical depth.


                            ┌─────────────────────────────────────────┐
                            │            METAFLOW ENGINE              │
                            │      Declarative Workflow Platform      │
                            └────────────────────┬────────────────────┘
                                                 │
          ┌──────────────────────────────────────┼──────────────────────────────────────┐
          │                                      │                                      │
          ▼                                      ▼                                      ▼
┌───────────────────────┐            ┌───────────────────────┐            ┌───────────────────────┐
│    ONTOLOGY LAYER     │            │    ACTIONS ENGINE     │            │   PROCESS CANVAS      │
│  ─────────────────    │            │  ─────────────────    │            │  ─────────────────    │
│                       │            │                       │            │                       │
│  ObjectTypes {        │            │  {                    │            │   ┌─────┐   ┌─────┐   │
│    properties: {...}  │───────────▶│    parameters: [...], │───────────▶│   │Draft│──▶│ Rev │   │
│    relations: [...]   │            │    criteria: [...],   │            │   └─────┘   └──┬──┘   │
│  }                    │            │    rules: [...]       │            │        ╲      │      │
│         │             │            │  }                    │            │         ╲     ▼      │
│         ▼             │            │         │             │            │          ┌─────┐    │
│  ┌─────────────┐      │            │         ▼             │            │          │Appr │    │
│  │   JSONB     │      │            │  ┌─────────────┐      │            │          └─────┘    │
│  │   Config    │      │            │  │  PL/pgSQL   │      │            │                      │
│  └─────────────┘      │            │  │  1300 LOC   │      │            │  ReactFlow + Auto    │
└───────────────────────┘            │  └──────┬──────┘      │            │  State Transitions   │
                                     │         │             │            └───────────────────────┘
                                     └─────────┼─────────────┘
                                               │
                    ┌──────────────────────────┴──────────────────────────┐
                    │                                                      │
                    ▼                                                      ▼
     ┌────────────────────────────────┐             ┌────────────────────────────────┐
     │      CRITERIA EVALUATION       │             │        RULE EXECUTION          │
     │  ────────────────────────────  │             │  ────────────────────────────  │
     │                                │             │                                │
     │  Expression Tree (recursive)   │             │  • modify_object               │
     │                                │             │  • create_object               │
     │     ┌─────┐                    │             │  • delete_object               │
     │     │ AND │                    │             │  • link_objects                │
     │     └──┬──┘                    │             │                                │
     │    ┌───┴───┐                   │             │  Property Sources:             │
     │    ▼       ▼                   │             │  ─────────────────             │
     │  ┌───┐   ┌───┐                 │             │  static | parameter            │
     │  │ = │   │OR │                 │             │  current_user | timestamp      │
     │  └───┘   └─┬─┘                 │             │  object_property               │
     │        ┌───┴───┐               │             │         │                      │
     │        ▼       ▼               │             │         ▼                      │
     │      ┌───┐   ┌───┐             │             │  ┌─────────────────┐           │
     │      │ > │   │ANY│─ M:N ──────┼─────────────┼─▶│ ATOMIC COMMIT   │           │
     │      └───┘   └───┘             │             │  │ (transaction)   │           │
     │                                │             │  └─────────────────┘           │
     │  order.customer.status = ?     │             │                                │
     │  └─┬──┘└──┬───┘└──┬──┘         │             │                                │
     │    │     │      │              │             │                                │
     │   base  M:1   property         │             │                                │
     │    │   join     │              │             │                                │
     │    └─────┴──────┘              │             │                                │
     │          │                     │             │                                │
     │          ▼                     │             │                                │
     │   Dynamic SQL Generation       │             │                                │
     └────────────────────────────────┘             └────────────────────────────────┘
                    │                                               │
                    └───────────────────────┬───────────────────────┘
                                            │
                                            ▼
                         ┌─────────────────────────────────────┐
                         │            POSTGRESQL               │
                         │  ─────────────────────────────────  │
                         │   metaflow.objects    (JSONB data)  │
                         │   metaflow.relations  (M:N links)   │
                         │   metaflow.action_types (configs)   │
                         └─────────────────────────────────────┘
            

Notes

The interesting problem was pushing business logic to the database. Actions are JSON configs—parameters, criteria trees, execution rules. The PL/pgSQL engine interprets them at runtime. No application code for each new workflow.

Criteria evaluation is recursive. AND/OR operators, comparison operators, property path traversal across relationships. order.customer.status resolves to a JOIN at query time. M:N relationships support ANY/ALL quantifiers.

What I'd revisit: tests from day one, vector search for document similarity, and a proper query builder instead of string concatenation in SQL generation.

Next.jsReactTypeScriptSupabasePostgreSQLClaude AIReactFlowTLDraw

Education

NIT Trichy

M.Tech, Machine Learning

Experience

Morgan Stanley

7.5 years in Product

Personal project. Code available on request.