File tree Expand file tree Collapse file tree
langgraph_samples/human_in_the_loop Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Human-in-the-Loop Samples
2+
3+ Two approaches to implementing human-in-the-loop approval workflows with LangGraph and Temporal.
4+
5+ ## Samples
6+
7+ ### [ approval_graph_interrupt] ( ./approval_graph_interrupt/ )
8+
9+ Uses LangGraph's ` interrupt() ` function to pause graph execution.
10+
11+ - Graph calls ` interrupt(request_data) ` to pause
12+ - Workflow detects ` __interrupt__ ` in result, waits for signal
13+ - Workflow resumes graph with ` Command(resume=response) `
14+
15+ ** Best for:** Standard LangGraph patterns, portable graph definitions.
16+
17+ ### [ approval_wait_condition] ( ./approval_wait_condition/ )
18+
19+ Uses ` run_in_workflow=True ` to access Temporal operations directly in graph nodes.
20+
21+ - Node marked with ` metadata={"run_in_workflow": True} `
22+ - Node uses ` workflow.instance() ` to access workflow
23+ - Node waits directly with ` workflow.wait_condition() `
24+
25+ ** Best for:** Keeping all wait logic encapsulated in the graph, simpler workflow code.
26+
27+ ## Quick Comparison
28+
29+ | Aspect | graph_interrupt | wait_condition |
30+ | --------| -----------------| ----------------|
31+ | Wait logic location | Workflow | Graph node |
32+ | Graph portability | Higher | Lower |
33+ | Workflow complexity | More code | Less code |
34+ | Temporal API access | Indirect | Direct |
You can’t perform that action at this time.
0 commit comments