Building Human-in-the-Loop Workflows with LangGraph
Fully autonomous AI pipelines are a liability until you trust them completely. For WREXT, a blog automation platform I'm building at Revnix, I needed a way to automate 90% of the work while keeping humans in the loop for the decisions that matter.
LangGraph's interrupt mechanism is built exactly for this.
The pipeline
WREXT has four stages:
- 1.**Topic discovery** — crawls trends, competitor content, and keyword data to surface 20-30 potential topics
- 2.**Relevance scoring** — LLM scores each topic against the client's niche and audience
- 3.**Outline generation** — creates a detailed outline with H2/H3 structure, key points, and target word count
- 4.**Final generation** — writes the full SEO-optimized post
Stages 1, 2, and 4 are fully automated. Stage 3 is where humans should review.
LangGraph interrupt
from langgraph.graph import StateGraph, ENDdef outline_review_node(state: BlogState): # This node pauses and waits for human approval return interrupt({ "outline": state["outline"], "topic": state["topic"], "message": "Review outline and approve or edit before generation" })
builder = StateGraph(BlogState) builder.add_node("discover_topics", discover_topics) builder.add_node("score_topics", score_topics) builder.add_node("generate_outline", generate_outline) builder.add_node("outline_review", outline_review_node) # Human checkpoint builder.add_node("generate_post", generate_post) ```
The Streamlit dashboard
The review UI is a Streamlit app that polls the database for pending approvals. Editors see the outline, can edit it inline, then approve. The LangGraph graph resumes from the checkpoint.
# Resume after human edit
thread_config = {"configurable": {"thread_id": thread_id}}
graph.invoke(
Command(resume={"approved_outline": edited_outline}),
config=thread_config
)What I learned
Human-in-the-loop isn't just about catching errors — it's about building trust. The content team at Revnix didn't trust the AI at first. After two weeks of reviewing outlines and seeing consistent quality, they started approving without edits. That's the goal: automate until the human is bored of reviewing.
The interrupt pattern in LangGraph makes this trivial to implement. The harder problem is UX — making the review interface fast and frictionless enough that people actually use it.
Working on something similar? I'm available for consulting and contracts.
Get in touch →