Pause/Resume
Execution

Interactive execution control for WebHarvest IDE

Temporarily halt scraper execution and continue later from the same point. Perfect for debugging, resource management, and interactive development workflows.

Key Features

Pause

Halt execution at any time, state preserved

Resume

Continue from exact point where paused

Stop

Permanently cancel execution

API Control

Programmatic access via REST endpoints

Quick Start

Using UI Buttons

  1. Run any configuration (click ▶ Run button)
  2. During execution, control buttons appear below progress bar
  3. Click ⏸ Pause to halt execution
  4. Inspect variables in Variables panel while paused
  5. Click ▶ Resume to continue
  6. Or click ⏹ Stop to cancel permanently

Execution Control Buttons

Running State:
┌──────────────────────────────────┐
│ Progress: ████████░░░░░ 60%      │
│ [⏸ Pause]  [⏹ Stop]             │
└──────────────────────────────────┘

Paused State:
┌──────────────────────────────────┐
│ Status: ⏸ Paused                 │
│ [▶ Resume]  [⏹ Stop]            │
└──────────────────────────────────┘

API Reference

POST /api/execution/{id}/pause

Pauses a running execution.

Request
POST /api/execution/abc-123-def-456/pause
Response (Success)
{
  "success": true,
  "executionId": "abc-123-def-456",
  "action": "pause",
  "status": "PAUSED"
}

POST /api/execution/{id}/resume

Resumes a paused execution.

Request
POST /api/execution/abc-123-def-456/resume

POST /api/execution/{id}/stop

Stops execution permanently (cannot resume).

Request
POST /api/execution/abc-123-def-456/stop

Use Cases

1. Interactive Debugging

Workflow
1. Run scraper
2. Pause after HTTP request
3. Inspect HTML in Variables panel
4. Verify XPath selectors work
5. Resume to continue
6. Pause again after next step
7. Iterate until working perfectly

2. Resource Management

Pause expensive scrapers during peak hours:

JavaScript
const hour = new Date().getHours();

if (hour >= 9 && hour <= 17) {  // Business hours
    await fetch(`/api/execution/${executionId}/pause`, {
        method: 'POST'
    });
    console.log('Paused during peak hours');
}

3. Manual Data Review

Pause to manually verify scraped data before continuing:

XML Configuration
<config>
  <!-- Scrape first page -->
  <http url="https://example.com/page1"/>
  <def var="page1">${http}</def>
  
  <!-- PAUSE HERE: Check if page1 looks correct -->
  
  <!-- Continue with processing -->
  <xpath expression="//data">
    <html-to-xml>${page1}</html-to-xml>
  </xpath>
</config>

Technical Implementation

How It Works

Pause mechanism:

Resume mechanism:

Stop mechanism:

Current Limitations (v2.2.0)

Basic Implementation

Advanced pause/resume with checkpoints coming in v2.3.0

Related Documentation