Skip to content

Aditya-tec/workflow-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Workflow Agent

An autonomous enterprise workflow system that monitors GitHub and Slack in real time, uses LLMs to classify and analyse events, coordinates specialist AI agents, and delivers structured reports — all without human intervention.


What it does

When a GitHub issue or pull request is opened, the system automatically:

  1. Receives the event via webhook
  2. Classifies it using an LLM orchestrator
  3. Spawns specialist sub-agents to analyse, gather context, communicate, and document
  4. Posts a structured analysis to Slack
  5. Comments directly on the GitHub issue or PR
  6. Writes an immutable audit trail
  7. Updates a live dashboard in real time

Zero manual intervention. Every step is logged, traced, and observable.


Architecture

flowchart LR
  %% Entry points
  gh[GitHub Webhooks]
  sl[Slack Events]

  %% Ingestion and orchestration
  api[[Express Webhook Server]]
  q[(pg-boss Queue\nPostgreSQL-backed)]
  orch{{Orchestrator LLM\nGroq + workflow plan}}

  %% Specialist agents
  subgraph agents[Specialist Agent Pod]
    direction LR
    data[Data\ncontext extraction]
    analysis[Analysis\nseverity + root cause]
    comms[Comms\nSlack + GitHub response]
    docs[Docs\naudit trail + completion]
  end

  %% Persistence and observability
  db[(Neon PostgreSQL\nevents · workflows · steps · llm_logs · audit_log)]
  dash[[Next.js Dashboard\nVercel + live SSE]]

  gh --> api
  sl --> api
  api --> q
  q --> orch

  orch -->|critical_bug_triage / pr_review_assist| data
  orch -->|slack_reply / general| analysis
  data --> analysis --> comms --> docs
  docs --> db

  data -. context .-> db
  analysis -. token log .-> db
  comms -. messages .-> db
  dash <-->|stream + detail views| db

  classDef source fill:#0f172a,stroke:#38bdf8,color:#e2e8f0,stroke-width:1.5px;
  classDef core fill:#111827,stroke:#f59e0b,color:#f9fafb,stroke-width:1.5px;
  classDef agent fill:#1f2937,stroke:#34d399,color:#f9fafb,stroke-width:1.5px;
  classDef store fill:#052e16,stroke:#22c55e,color:#ecfdf5,stroke-width:1.5px;
  classDef ui fill:#312e81,stroke:#a78bfa,color:#f5f3ff,stroke-width:1.5px;

  class gh,sl source;
  class api,q,orch core;
  class data,analysis,comms,docs agent;
  class db store;
  class dash ui;
Loading

Live demo


Key features

Multi-agent orchestration — A central orchestrator LLM classifies each event and delegates to four specialist agents, each with a narrow system prompt and a single responsibility.

Durable job queue — Uses pg-boss, a PostgreSQL-backed job queue. No Redis. No extra services. Survives server restarts with automatic retries.

GitHub issue + PR handling — Analyses both issues and pull requests. Posts risk assessments and fix recommendations as comments directly on GitHub.

Slack notifications — Structured, severity-coded messages posted to a Slack channel on every workflow run.

Immutable audit trail — Every action taken is logged: what happened, which agents ran, what they decided, how long it took, how many tokens were used.

Token cost observability — Every LLM call is logged with input tokens, output tokens, latency, and cost. Aggregated totals visible on the dashboard.

Live dashboard — Real-time Server-Sent Events (SSE) stream workflow updates to the Next.js frontend without polling.

Human-in-the-loop ready — Orchestrator can flag workflows requiring human approval before agents execute.


Tech stack

Layer Technology
Backend Node.js + Express
Queue pg-boss (PostgreSQL-backed)
Database Neon PostgreSQL
ORM Prisma
LLM Groq API (Llama 3.3 70B)
Slack Slack Web API
GitHub GitHub Webhooks + REST API
Frontend Next.js + Tailwind CSS
Backend hosting Render
Frontend hosting Vercel

Database schema

Five tables power the entire system:

  • events — normalised incoming webhooks with source, type, payload, status
  • workflows — one row per workflow run, stores the LLM plan and current status
  • workflow_steps — one row per agent execution, stores input and output
  • llm_logs — every LLM call with model, tokens, latency, and cost
  • audit_log — human-readable summary written by the Docs agent after each workflow

Workflow templates

The orchestrator picks from four templates based on the event:

Template Trigger Agents
critical_bug_triage Critical bug issues data → analysis → comms → docs
pr_review_assist Pull request opened data → analysis → comms → docs
slack_reply Slack mention analysis → comms → docs
general Any other event data → analysis → comms → docs

Agent responsibilities

Data agent — Extracts structured context from the raw event payload. For issues: title, body, labels, repo. For PRs: branch names, file count, additions, deletions.

Analysis agent — Sends context to Groq LLM with a focused prompt. Returns severity (low/medium/high/critical), likely cause, recommended action, and a human-readable summary.

Comms agent — Posts a formatted Slack message with severity emoji and full analysis. Posts a comment on the GitHub issue or PR via the GitHub REST API.

Docs agent — Writes a structured audit log entry, marks the workflow as completed, and updates the event status.


About

An autonomous enterprise workflow system that monitors GitHub and Slack in real time

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors