Skip to content
Back to documentation

Understanding Tasks and Blocks

Learn the core execution model of Mnemosyne Doppelganger by understanding how tasks and blocks work together to automate real browsers reliably.

Running Tasks#

Mnemosyne Doppelganger provides flexible ways to execute tasks, enabling full control over browser automation. Tasks can be run manually via the dashboard, exported as JSON for offline execution, or triggered programmatically using the live API.

This guide covers all execution methods, the two main types of tasks, and optional extraction scripts.


Types of Tasks#

Doppelganger supports two primary task types:

1. Scrape Tasks#

Scrape tasks are lightweight automation jobs focused on extracting data from a single URL with minimal input. Key characteristics:

  • Specify a target URL
  • Optionally set wait times for page load or dynamic content
  • Supports optional JavaScript extraction scripts to:
    • Access Shadow DOM content
    • Clean or transform data
    • Convert extracted content into structured JSON
  • Ideal for quick data retrieval, monitoring, or scraping single pages

2. Agent Tasks#

Agent tasks provide full automation control using visual blocks. Key characteristics:

  • Composed of multiple blocks such as:
    • Navigate
    • Type
    • Click
    • Press keys
    • Extract data
    • Run custom JavaScript
  • Specify target URL and wait conditions
  • Can implement human-like behaviors:
    • Idle cursor movements
    • Natural typing with optional typos
    • Scrolling and overscroll patterns
  • Supports optional JavaScript extraction scripts for:
    • Shadow DOM scraping
    • Data cleaning and normalization
    • Converting page content into JSON objects
  • Designed for complex workflows, multi-step interactions, and dynamic websites

1. Running Tasks from the Dashboard#

To execute a task via the dashboard:

  1. Open http://localhost:11345.
  2. Navigate to the Tasks section.
  3. Select Edit Task on the task you want to run.
  4. Click Run Task.

The execution follows all configured behaviors for either scrape or agent tasks, with real browser rendering and JavaScript support.


2. Running Exported Tasks#

Export tasks as JSON for portability and reproducibility:

  • Share scripts across environments
  • Run tasks on different machines
  • Integrate with other systems

Execution of exported tasks preserves all configurations, including optional extraction scripts, whether scrape or agent type.


3. Running Tasks via the Live API#

Each task exposes a live API endpoint:

http://localhost:11345/tasks/:id/api

Where :id is the task’s unique identifier.

Example using curl:

curl -X POST http://localhost:11345/tasks/task_123456/api
  • Executes the latest task state

  • Supports both Scrape and Agent task types

  • Includes optional extraction scripts if configured

  • Returns execution results programmatically

This allows event-driven automation and integration with orchestration platforms like n8n.


4. Task Execution Behavior#

All tasks, regardless of type or execution method:

  • Run deterministically
  • Respect configured human-like behaviors (Agent tasks)
  • Perform JavaScript extraction as defined
  • Store data locally for privacy and security

Scrape tasks are ideal for simple, fast data retrieval, while Agent tasks enable sophisticated, multi-step automation. Extraction scripts provide advanced control for cleaning or structuring data into JSON, including Shadow DOM elements.


5. Integrating with n8n or Other Tools#

  • Use HTTP Request nodes to POST to the live API
  • Pass runtime inputs if needed
  • Capture results for downstream workflows
  • No additional adapters required

This makes Doppelganger a versatile backend engine for automation pipelines.


6. Best Practices#

  • Test all tasks in the dashboard first
  • Keep Agent tasks modular with reusable blocks
  • Store exported JSON for version control
  • Use extraction scripts when handling dynamic or complex page structures
  • Secure API endpoints on self-hosted environments

7. Next Steps#

After mastering task execution, explore:

  • Task Block Reference
  • JavaScript extraction examples
  • Passing dynamic inputs
  • Advanced integrations
  • Scheduling and orchestration