Skip to content

dougdevitre/justice-workflow-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📦 Justice Workflow Automation Engine — Zapier for Legal Processes

License: MIT TypeScript 5.0 Contributions Welcome PRs Welcome

The Problem

Legal processes involve dozens of repetitive steps across systems — filing triggers notifications, deadlines trigger reminders, missed actions need recovery plans. Court administrators manually coordinate between case management systems, notification services, and document generators. Legal aid organizations re-do the same multi-step procedures hundreds of times per week. All done manually. All error-prone. All burning time that should go to helping people.

The Solution

An event-driven workflow automation engine with a no-code builder UI. Define triggers, conditions, and actions — the engine handles the rest.

  • "If filing submitted → notify court + generate copy"
  • "If deadline in 7 days → send reminder to all parties"
  • "If deadline missed → create recovery plan + alert attorney"
graph LR
    subgraph Sources["Event Sources"]
        CE[Court Events]
        UA[User Actions]
        DL[Deadlines]
        EA[External APIs]
    end

    Sources --> EB[Event Bus]
    EB --> TE[Trigger Evaluator]

    subgraph Engine["Workflow Engine"]
        SE[Step Executor]
        CV[Condition Evaluator]
        AR[Action Runner]
    end

    TE --> Engine

    subgraph Actions
        N[Notify]
        GD[Generate Doc]
        UC[Update Case]
        CT[Create Task]
        SA[Send Alert]
    end

    Engine --> Actions
    Actions --> AL[Audit Log]
Loading

Who This Helps

  • Court administrators — automate repetitive coordination tasks across systems
  • Legal aid operations — scale case processing without scaling headcount
  • Case managers — never miss a deadline or follow-up step again
  • Justice tech developers — build on a composable workflow runtime

Features

  • Event-driven trigger system — react to court events, deadlines, user actions, and external APIs in real time
  • No-code workflow builder UI — visual drag-and-drop canvas for creating workflows without writing code
  • Pre-built workflow templates — ready-made templates for filing, deadline tracking, and notification flows
  • Conditional branching and loops — if/else logic, loops, and parallel execution paths
  • Action library — email, SMS, document generation, API calls, case updates, and task creation
  • Execution history and audit trail — complete log of every workflow run with step-by-step results

Quick Start

npm install @justice-os/workflow-engine
import { WorkflowBuilder, WorkflowEngine } from '@justice-os/workflow-engine';

// Create a deadline reminder workflow
const workflow = new WorkflowBuilder('deadline-reminder')
  .trigger('schedule', { cron: '0 9 * * *' }) // Every morning at 9am
  .when({
    field: 'case.nextDeadline',
    operator: 'within',
    value: '7 days',
  })
  .then('notify', {
    channel: 'email',
    to: '{{ case.assignedAttorney.email }}',
    template: 'deadline-approaching',
    data: {
      caseName: '{{ case.title }}',
      deadline: '{{ case.nextDeadline }}',
      daysRemaining: '{{ daysUntil(case.nextDeadline) }}',
    },
  })
  .then('createTask', {
    title: 'Review upcoming deadline: {{ case.title }}',
    assignee: '{{ case.assignedAttorney.id }}',
    dueDate: '{{ subtractDays(case.nextDeadline, 2) }}',
  })
  .build();

// Register and start the engine
const engine = new WorkflowEngine();
engine.register(workflow);
engine.start();

Project Structure

src/
├── index.ts
├── engine/
│   ├── workflow-engine.ts      # WorkflowEngine — main orchestrator
│   ├── step-executor.ts        # StepExecutor — run individual steps
│   └── condition-evaluator.ts  # ConditionEvaluator — if/else branching
├── triggers/
│   ├── trigger-manager.ts      # TriggerManager — register, evaluate
│   ├── event-trigger.ts        # EventTrigger — on event X
│   ├── schedule-trigger.ts     # ScheduleTrigger — cron-based
│   └── condition-trigger.ts    # ConditionTrigger — when condition met
├── actions/
│   ├── action-registry.ts      # ActionRegistry — available actions
│   ├── notify-action.ts        # NotifyAction — email/SMS/push
│   ├── document-action.ts      # DocumentAction — generate docs
│   └── api-action.ts           # ApiAction — external API calls
├── builder/
│   ├── workflow-builder.ts     # WorkflowBuilder — fluent API
│   └── templates/
│       └── README.md           # How to create workflow templates
├── components/
│   ├── WorkflowCanvas.tsx      # Visual workflow builder
│   ├── TriggerConfig.tsx       # Trigger configuration UI
│   └── ActionConfig.tsx        # Action configuration UI
└── types/
    └── index.ts

Roadmap

  • Visual workflow builder with drag-and-drop canvas
  • Pre-built template marketplace for common legal workflows
  • Parallel execution paths and fork/join patterns
  • Workflow versioning and rollback support
  • Integration connectors for major case management systems
  • Real-time workflow monitoring dashboard with live execution status

Justice OS Ecosystem

This repository is part of the Justice OS open-source ecosystem — 32 interconnected projects building the infrastructure for accessible justice technology.

Core System Layer

Repository Description
justice-os Core modular platform — the foundation
justice-api-gateway Interoperability layer for courts
legal-identity-layer Universal legal identity and auth
case-continuity-engine Never lose case history across systems
offline-justice-sync Works without internet — local-first sync

User Experience Layer

Repository Description
justice-navigator Google Maps for legal problems
mobile-court-access Mobile-first court access kit
cognitive-load-ui Design system for stressed users
multilingual-justice Real-time legal translation
voice-legal-interface Justice without reading or typing
legal-plain-language Turn legalese into human language

AI + Intelligence Layer

Repository Description
vetted-legal-ai RAG engine with citation validation
justice-knowledge-graph Open data layer for laws and procedures
legal-ai-guardrails AI safety SDK for justice use
emotional-intelligence-ai Reduce conflict, improve outcomes
ai-reasoning-engine Show your work for AI decisions

Infrastructure + Trust Layer

Repository Description
evidence-vault Privacy-first secure evidence storage
court-notification-engine Smart deadline and hearing alerts
justice-analytics Bias detection and disparity dashboards
evidence-timeline Evidence timeline builder

Tools + Automation Layer

Repository Description
court-doc-engine TurboTax for legal filings
justice-workflow-engine Zapier for legal processes
pro-se-toolkit Self-represented litigant tools
justice-score-engine Access-to-justice measurement
justice-app-generator No-code builder for justice tools

Quality + Testing Layer

Repository Description
justice-persona-simulator Test products against real human realities
justice-experiment-lab A/B testing for justice outcomes

Adoption Layer

Repository Description
digital-literacy-sim Digital literacy simulator
legal-resource-discovery Find the right help instantly
court-simulation-sandbox Practice before the real thing
justice-components Reusable component library
justice-dev-starter-kit Ultimate boilerplate for justice tech builders

Built with purpose. Open by design. Justice for all.


⚠️ Disclaimer

This project is provided for informational and educational purposes only and does not constitute legal advice, legal representation, or an attorney-client relationship. No warranty is made regarding accuracy, completeness, or fitness for any particular legal matter. Always consult a licensed attorney in your jurisdiction before making legal decisions. Use of this software does not create any professional-client relationship.


Built by Doug Devitre

I build AI-powered platforms that solve real problems. I also speak about it.

CoTrackPro · admin@cotrackpro.com

Hire me: AI platform development · Strategic consulting · Keynote speaking

AWS AI/Cloud/Dev Certified · UX Certified (NNg) · Certified Speaking Professional (NSA) Author of Screen to Screen Selling (McGraw Hill) · 100,000+ professionals trained

About

Zapier for legal processes — event-driven workflow automation engine

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors