Skip to content

Conversation

@Chibionos
Copy link
Contributor

@Chibionos Chibionos commented Jan 20, 2026

Summary

Add comprehensive sample demonstrating the suspend/resume pattern for LangGraph agents that need to pause execution for external work (RPA processes, human-in-the-loop, external APIs, etc.).

What's Included

Core Agent Variants

  • graph.py - Production agent with RPA process invocation using interrupt()
  • graph_simple.py - Simplified variant for testing without authentication
  • graph_calculator.py - 🆕 Calculator agent demonstrating RPA process invocation with bindings
  • demo_suspend_resume.py - Interactive demo showing complete suspend/resume cycle

Process Bindings 🆕

  • bindings.json - Process bindings for Add.Two.Number.API.Workflow.Tool
  • Environment-agnostic design using release keys
  • Production-ready workflow orchestration pattern

Documentation

  • README.md - Comprehensive usage guide with architecture explanation
  • MANUAL_TEST_GUIDE.md - Step-by-step testing instructions
  • SUSPEND_RESUME_FIX.md - Technical details on the implementation
  • AGENTS.md - Agent variants overview

Testing & Evaluation

  • test_full_cycle.py - End-to-end suspend/resume validation
  • test_suspend_step1.py / test_suspend_step2.py - Split-phase testing
  • test_resume_direct.py - Direct resume testing
  • test_suspend_resume_with_validation.py - Comprehensive validation with assertions
  • evaluations/eval-sets/ - Test evaluation sets for all agent variants
    • test_simple_no_auth.json - For agent-simple variant
    • test_calculator_process.json - For agent-calculator with RPA
    • test_calculator_single.json - Single test case for calculator
  • evaluations/evaluators/ - Contains ContainsEvaluator for validation

Configuration

  • pyproject.toml - Dependencies (requires uipath>=2.5.4)
  • langgraph.json - Agent configuration with 3 entry points
  • uipath.json - Runtime configuration
  • entry-points.json - 🆕 Entry point metadata with unique IDs for each variant

Key Features

Three Agent Variants - Production RPA, development-friendly, and calculator demonstrations
Process Bindings - 🆕 Real RPA process integration with bindings.json
Proper Suspend/Resume Pattern - Uses LangGraph's interrupt() for clean suspension points
Checkpoint Persistence - State saved to SQLite for reliable resume
Comprehensive Testing - Full test suite with validation and evaluations
Rich Documentation - README, guides, and inline documentation
Inspection Utilities - inspect_state.py for checkpoint database analysis

Use Cases

This sample is essential for:

  • Long-running RPA automations - Don't block agent while process executes
  • Human-in-the-loop workflows - Pause for human input, resume after
  • External API callbacks - Suspend while waiting for async responses
  • Multi-step cross-system processes - Coordinate work across platforms
  • Calculator operations via RPA - 🆕 Demonstrates structured input/output with processes

Testing

Run the interactive demo:

cd samples/tool-calling-suspend-resume
uv run python demo_suspend_resume.py

This demonstrates:

  1. Agent suspends at interrupt()SUSPENDS
  2. State persists to SQLite
  3. New process loads checkpoint
  4. Agent resumes → COMPLETES

Test with evaluations:

# Test simple agent (no auth needed)
uv run uipath eval agent-simple evaluations/eval-sets/test_simple_no_auth.json

# Test calculator agent with RPA process
uv run uipath eval agent-calculator evaluations/eval-sets/test_calculator_process.json

Architecture

The suspend/resume pattern enables:

  • Stateful execution across process boundaries
  • Reliable recovery from checkpoints
  • Clean separation between agent logic and external work
  • Scalable long-running automations
  • Environment-agnostic process invocation via bindings

Recent Updates

  • ✅ Added calculator agent variant with RPA process invocation
  • ✅ Configured process bindings for Add.Two.Number.API.Workflow.Tool
  • ✅ Added evaluation sets for all agent variants
  • ✅ Registered agent-calculator entry point in langgraph.json
  • ✅ Updated documentation to cover all three variants

🤖 Generated with Claude Code

@Chibionos Chibionos force-pushed the feat/suspend-resume-sample branch 2 times, most recently from bcc15fe to 0d505e2 Compare January 22, 2026 12:17
Add comprehensive sample demonstrating suspend/resume pattern for agents
that need to pause execution for external work (RPA processes, HITL, etc.).

**Sample Contents:**
- graph.py: Agent with RPA process invocation using interrupt()
- graph_simple.py: Simplified variant for testing without auth
- demo_suspend_resume.py: Interactive demo showing full suspend/resume cycle
- Comprehensive test files for validation
- README with usage guide and architecture explanation
- Evaluation sets for testing suspend/resume behavior

**Key Features:**
- Shows proper use of LangGraph's interrupt() for suspension
- Demonstrates checkpoint persistence with SQLite
- Includes both RPA invocation and simplified test variants
- Comprehensive documentation and testing

**Use Cases:**
- Long-running RPA automations
- Human-in-the-loop workflows
- External API calls with async callbacks
- Multi-step processes across systems

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

fix: remove missing custom evaluators from eval set

The eval set was referencing two custom evaluators that don't exist:
- ResumeCompletedEvaluator
- SuspendResumeTrajectoryEvaluator

This caused the eval command to fail with:
'Could not find the following evaluators'

Changes:
- Removed evaluatorRefs and evaluationCriterias
- Removed expectedOutputs (agent suspends, doesn't complete on first run)
- Updated description to clarify suspend/resume testing workflow
- Kept simple inputs for testing suspend phase

The eval set now works for demonstrating suspend behavior without
requiring custom evaluators. For full suspend/resume testing with
evaluators, use the demo scripts or --resume flag.

feat: configure eval set to use built-in ContainsEvaluator

- Add evaluator JSON configuration for uipath-contains evaluator
- Update eval set to reference uipath-contains evaluator
- Configure evaluationCriterias to check for "Completed with resume data" in agent output
- Eval command now runs successfully with suspend/resume workflow

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

feat: add calculator agent with RPA process invocation

Add new agent variant demonstrating suspend/resume with calculator RPA process:

**New Files:**
- graph_calculator.py - Calculator agent invoking RPA process for arithmetic operations
- agent-calculator.py - Symlink to graph_calculator.py for entry point
- agent-calculator.mermaid - Visual flowchart for calculator agent
- evaluations/eval-sets/test_calculator_process.json - Evaluation set with 4 test cases:
  * Addition: 12 + 12 = 24
  * Subtraction: 50 - 20 = 30
  * Multiplication: 7 * 8 = 56
  * Division: 100 / 4 = 25

**Updated Files:**
- entry-points.json - Add agent-calculator entry point definition
- README.md - Document calculator variant in "Three Graph Variants" section

**Key Features:**
- Demonstrates InvokeProcess with structured input (operands + operator)
- Shows how to extract calculation results from RPA process output
- Reuses existing uipath-contains evaluator for result validation
- Complete with evaluation set for automated testing

**Usage:**
```bash
uv run uipath eval agent-calculator evaluations/eval-sets/test_calculator_process.json
```

This complements the existing suspend/resume sample with a practical
computational workflow example.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

fix: register agent-calculator in langgraph.json and add single test eval

**Fixes:**
- Add agent-calculator to langgraph.json graphs mapping
- This resolves "Graph 'agent-calculator' not found" error

**New Files:**
- evaluations/eval-sets/test_calculator_single.json - Single test case eval set
  * Contains only one evaluation (12 + 12 = 24) for simpler testing

**Regenerated Files:**
- entry-points.json - Auto-regenerated by uipath init with 3 entrypoints
- agent-calculator.mermaid - Updated diagram file

Now `uv run uipath eval agent-calculator evaluations/eval-sets/test_calculator_single.json`
will work correctly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

feat: add process bindings for calculator suspend/resume sample

- Add bindings.json with Add.Two.Number.API.Workflow.Tool process configuration
- Update graph_calculator.py to use process from bindings instead of hardcoded values
- Regenerate entry-points.json unique IDs for agent variants

This enables the calculator agent to invoke real RPA processes with proper
suspend/resume behavior, demonstrating production-ready workflow orchestration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@Chibionos Chibionos force-pushed the feat/suspend-resume-sample branch from 0d505e2 to 027753c Compare January 22, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant