LabBeginner~10 min

Govern LangGraph Workflow

Supported in BHANUJPython 3.12+LangGraphAgents RuntimeWORKFLOW_STEP

Capture provider-neutral runtime evidence from a deterministic LangGraph workflow and inspect every execution step in Agents Runtime.

Execution evidence SUCCEEDED
load_claim2 events
check_policy2 events
evaluate_evidence2 events
make_decision2 events

8 WORKFLOW_STEP events · 0 TOOL_CALL events

Overview

Observe the run. Keep LangGraph in control.

The lab uses only local fixture data and makes the same deterministic insurance-claim decision every time. LangGraph owns execution and the decision; BHANUJ receives an independent, one-way record of what executed.

You will learn

How a LangGraph node maps to a WORKFLOW_STEP event pair.

You will build

A four-stage workflow with one correlated runtime execution.

Architecture

A deliberately boring workflow.

Execution plane

LangGraph

Runs the workflow and produces the decision.

Evidence plane

BHANUJ Agents Runtime

Records ordered execution evidence.

STARTload_claimcheck_policyevaluate_evidencemake_decisionEND

Every node emits STARTED and COMPLETED evidence with event_type=WORKFLOW_STEP and source_kind=langgraph.node.

Prerequisites

What you need.

  • Python 3.12 or later and pip.
  • Git to clone or fork the public labs repository.
  • The BHANUJ OSS repository only when you want to send runtime evidence.

Run locally

Run the standalone workflow first.

This path does not require credentials, a database, or the governance API.

terminal
git clone https://github.com/Bhanuj-AI/labs.git
cd labs/agent-frameworks/langgraph/govern-langgraph-workflow
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
terminal
python app.py
expected output
Claim: CLM-001
Policy active: true
Damage verified: true
Decision: APPROVED

Enable evidence

Connect the same workflow to BHANUJ.

Start the OSS API in development mode, then set the three guide-side connection variables and run the unchanged application.

terminal · AI Governance OSS
cd /path/to/ai-governance-oss
AI_GOVERNANCE_AUTH_MODE=development \
  uv run uvicorn ai_governance.api.app:app --reload
terminal · lab repository
export AI_GOVERNANCE_BASE_URL=http://localhost:8000
export AI_GOVERNANCE_ORGANIZATION_ID=org_default
export AI_GOVERNANCE_PROJECT_ID=project_default
python app.py
expected governed output
Claim: CLM-001
Policy active: true
Damage verified: true
Decision: APPROVED
BHANUJ execution ID: ae380ac2-9004-4c78-b4e1-a33d730a40da
BHANUJ evidence status: SUCCEEDED
Failure isolation: evidence delivery is fail-open. If BHANUJ is unavailable, the LangGraph workflow still returns its deterministic decision; the application reports a DEGRADED evidence status and never fabricates a successful completion.

Inspect the execution

Use one execution ID to find the whole run.

The CLI prints the BHANUJ execution ID. Open Agents Runtime and find that exact ID to view the timeline below.

Agents Runtime timeline SUCCEEDED
  1. 1load_claim · Step StartedWORKFLOW_STEP
  2. 2load_claim · Step CompletedWORKFLOW_STEP
  3. 3check_policy · Step StartedWORKFLOW_STEP
  4. 4check_policy · Step CompletedWORKFLOW_STEP
  5. 5evaluate_evidence · Step StartedWORKFLOW_STEP
  6. 6evaluate_evidence · Step CompletedWORKFLOW_STEP
  7. 7make_decision · Step StartedWORKFLOW_STEP
  8. 8make_decision · Step CompletedWORKFLOW_STEP

There are four logical workflow steps, eight lifecycle events, and zero TOOL_CALL events. Tool calls remain reserved for actual external tool invocations.

Ready to run it?

Fork the lab, run it locally, then enable runtime evidence when the BHANUJ API is available.