Site Workflows
Overview
Site Workflows are MoleClaw's declarative automation system. Define a series of steps in JSON format to automate website operations without writing code.
Core principle: Extension = interpreter engine, Manifest = content distribution. No workflow definitions are hardcoded in the source code — all workflows are distributed and synced via Manifest files.
Built-in Workflows
MoleClaw comes with the following predefined workflows:
| Workflow | Description | URL Match |
|---|---|---|
| JD Product Search | Search products on JD.com, returns product card list | All pages |
| Baidu Search | Search keywords on Baidu, returns search result list | All pages |
| Boss Zhipin Message Reply | Operate chats, collect messages, auto-reply on Boss Zhipin | *.zhipin.com |
| Taobao Product Search | Search products on Taobao, returns product list | All pages |
| Taobao Product Details | Collect structured data from Taobao/Tmall product detail pages | All pages |
| Toutiao Hot List | Collect the Top 100 trending news from Toutiao Hot List | All pages |
Workflow Structure
Each workflow is a JSON object with the following fields:
json
{
"name": "workflow_name",
"label": "Display Label",
"description": "Workflow description — AI uses this to decide when to invoke it",
"url_patterns": ["*://*.example.com/*"],
"version": 1,
"enabled": true,
"parameters": {
"type": "object",
"properties": {
"keyword": {
"type": "string",
"description": "Search keyword"
}
},
"required": ["keyword"]
},
"plan": {
"version": 1,
"steps": [
{
"action": "tab_navigate",
"note": "Navigate to the target page",
"params": {
"action": "navigate",
"url": "https://example.com/search?q={{keyword}}"
},
"saveAs": "nav_result"
},
{
"action": "page_action",
"note": "Wait for results to load",
"params": {
"action": "wait_for_element",
"selector": ".results",
"timeout_ms": 10000
}
},
{
"action": "dom_manipulate",
"note": "Collect result data",
"params": {
"action": "query",
"selector": ".result-item",
"limit": 10
},
"saveAs": "items"
}
],
"resultPath": "items"
}
}Key Fields
url_patterns— URL matching rules using wildcard syntax; determines which pages the workflow is available onparameters— Parameter definitions in JSON Schema format, passed by the AI when invokingplan.steps— Array of steps, each calling a built-in toolplan.steps[].action— Name of the tool to callplan.steps[].params— Tool parameters, supportstemplate syntaxplan.steps[].saveAs— Store the step result as a variable for subsequent steps to referenceplan.steps[].when— Conditional execution; step is skipped when the value is falsyplan.steps[].retry— Retry configuration (maxAttempts,delayMs,backoffFactor)plan.steps[].onError— Error handling strategy ("continue"to skip and proceed)plan.resultPath— Path to extract the final result fromplan.closeOpenedTabs— Whether to close newly opened tabs after completion ("on_success")
Custom Workflows
Via the Options Page
- Right-click the Mole extension icon and select Options
- In the workflow management area, click Add Workflow
- Paste the workflow JSON definition
- Save — takes effect immediately
Via Remote Manifest Sync
MoleClaw supports syncing workflow Manifests from remote URLs.
Manifest Format
json
{
"version": 2,
"updatedAt": "2025-01-01T00:00:00Z",
"workflows": [
{ /* workflow definition */ },
{ /* workflow definition */ }
]
}Sync Mechanism
- Supports configuring multiple Manifest sources
- Auto-syncs every 6 hours by default (via Chrome Alarms API)
- Can also be manually triggered from the Options page
- Remote workflows are tagged as
source: "remote", user-added ones assource: "user"
TIP
You can host your own Manifest service to centrally manage and distribute workflows to your team.
