Skip to content
scalemorph
Contact uscontact@scalemorph.com

Case Study / Legal Tech

Legal Intake Automation System

A private full-stack conversational system focused on onboarding, escalation, document intake, and controlled automation in a high-trust legal environment.

← All case studies
Industry
Legal Tech
Project Type
Chatbot + Workflow Automation
Timeline
12 weeks
Technology
Next.js, NestJS, LangChain, Postgres, Redis, Monday.com, Amazon SES
Infrastructure
AWS

The challenge

Find the real problem.

A legal client wanted to automate onboarding without losing control.

They needed to automate client conversations, capture the information required to assess cases, and move people into their system faster - all without letting a chatbot drift into unsafe or unsolicited legal advice.

They had been using n8n, but it had become difficult to manage, difficult to scale, and difficult to control. The next version needed to be custom, more powerful, and integrated properly with the wider workflow, including their Monday.com-based process management.

Legacy automation had become a mess

The client had been relying on an n8n setup that was hard to control, hard to extend, and increasingly fragile.

No consistent escalation logic

When a conversation needed a human, there was no reliable path from chat to legal team review.

Risk of chatbot drift

In a legal environment, off-tone responses or accidental advice create trust and compliance problems quickly.

Document workflows created friction

Client onboarding, information capture, and document generation were slowing the team down at exactly the wrong point.

What we built

Connect the pieces.

A full-stack conversational system designed for control, continuity, and action.

This was not a simple chatbot layer dropped on top of a prompt. We built a structured system combining a Next.js frontend, a NestJS backend orchestration layer, LangChain-based conversation handling, Redis caching, Postgres data storage, Monday.com workflow integration, and AWS-based delivery into one controlled experience.

The goal was not just to answer messages. It was to guide users through onboarding, assess where the conversation was heading, support document workflows, and create a clean path to human escalation when needed.

Client-facing chat across web and SMS

We supported both an embedded website chat experience and SMS, giving the client a more flexible channel strategy. The Next.js frontend created a cleaner and more controlled environment for guided onboarding, while the hybrid model reduced over-reliance on SMS alone.

NestJS orchestration and workflow control

NestJS powered the backend API and orchestration layer. This gave the system a modular structure for managing conversation routing, workflow logic, document handling, integrations, and broader application behaviour - far more maintainable than the previous no-code setup.

Stateful conversation handling with LangChain

Rather than treating each message as an isolated prompt, the system evaluated messages within the context of an ongoing conversation. LangChain supported more structured decision-making, helping the system account for prior context, user intent, tone, and where the interaction was heading before generating a response.

Tone, sentiment, and direction analysis

We built custom scoring around how the conversation was progressing - including sentiment, direction, and overall quality of the exchange. That allowed the system to better match user tone, identify when a conversation was becoming uncertain or sensitive, and decide whether to continue assisting or hand off to a staff member.

Guardrails and human escalation

In a legal setting, the system needed boundaries. We implemented guardrails to keep the conversation focused, reduce drift, and support escalation into internal staff workflows when the conversation required judgment, review, or direct legal involvement. Monday.com was integrated as part of that internal operational path.

Data, caching, and application performance

Postgres handled persistent workflow and application data, while Redis supported caching and faster access to repeated or stateful operations. This gave the application a stronger foundation for responsiveness, reliability, and longer-term extensibility.

Document intake and generation

A major part of the build was automating onboarding and paperwork preparation. The system captured structured intake from users, mapped that information into the client's internal process, and generated PDFs and DOCX files to support legal document workflows behind the scenes.

Lower-cost delivery and reduced SMS reliance

The product was designed to reduce the number of conversations forced through paid SMS. By shifting part of the experience to web chat and moving away from Twilio toward Amazon SES where appropriate, the client gained a more cost-conscious communication model without losing continuity for users already in the system.

What we learned

Better with every build.

Good chat systems manage momentum, not just messages.

Through extensive research and iterative design, we discovered that the most effective conversational interfaces do not simply facilitate information exchange - they orchestrate rhythm, anticipation, and cognitive flow. This case study explores the principles that emerged from building a chat system that respects human attention.

n8n is useful early, but fragile at scale

n8n can be effective for smaller automations and early experimentation. But once a workflow becomes central to onboarding, client handling, internal operations, and document generation, no-code orchestration starts to show its limits.

Complexity grows quickly, debugging becomes painful, and incremental improvement gets harder. A coded system gives you far more control over structure, reliability, and long-term iteration.

Keyword logic does not scale

A lot of chatbot systems still rely too heavily on brittle filtering, keyword triggers, and rigid branching logic. That approach breaks down quickly in real conversations.

Users change tone, provide incomplete information, go off track, or reveal intent gradually. If you want a chatbot to behave intelligently, it needs a deeper analysis layer that considers the conversation as a whole rather than matching fragments of text.

Conversation state matters more than single-message prompts

The difference between a weak chatbot and a useful one often comes down to whether it understands context over time. A legal onboarding conversation is rarely one clean exchange.

It unfolds across multiple steps, changing levels of confidence, and different emotional states. Systems need to evaluate where the user is in the journey - not just reply to the most recent message.

Chat is strong for onboarding and pre-qualification

When implemented properly, chat can be extremely effective for early-stage conversion, intake, validation, and reducing friction in the first part of the customer journey.

Many users are perfectly happy to interact with a chatbot if it helps them move quickly, get answers, and complete the next step without delay.

Human escalation is part of the product, not a backup plan

There is no one-size-fits-all model where a chatbot fully replaces people in a trust-sensitive process. Some users want speed and self-service. Others want reassurance, nuance, or direct human support.

The strongest systems are hybrid: automation handles intake, categorisation, and repetitive guidance, while humans step in at the right moments for judgment, trust, and high-value conversations.

Tone and sentiment affect outcomes

A conversation is not just a sequence of inputs. It has direction. It can build trust, lose trust, become confused, or become more urgent.

Scoring tone, sentiment, and conversational direction helped us design a more adaptive system - one that could better match the user's state, recognise when things were drifting, and trigger escalation sooner when needed.

Workflow integration matters more than chatbot novelty

The real value in this project did not come from making the chatbot feel clever. It came from connecting conversation to operational outcomes: structured intake, internal review, case progression, and document generation.

In practice, chatbot quality matters far less than whether the system actually moves work forward.

Web channels give you better control than SMS alone

SMS can be useful, especially where responsiveness matters, but it becomes expensive and limiting when it carries too much of the product experience.

Moving more of the interaction into a web-based environment gave better control over the journey, improved the product surface area, and reduced the cost pressure of funneling too much communication through paid messaging.

Outcomes

A stronger foundation.

The project replaced a fragile n8n workflow with a custom system built for a more serious operational role - proper conversation state, tone analysis, document automation, and a clean escalation path into the client's internal team.

If you're building something similar, let's talk.

Next.jsNestJSLangChainPostgresRedisAWS

Start a project

Ready to build the platform
your team runs on?

Tell us where work is stalling — a portal, backend, marketplace, staffing system, an AI layer, or cloud ops.
In 30 minutes we’ll map the highest-leverage build first.

Book an introductionA conversation. No commitment.