Workflows
Workflows let you teach Mole repeatable tasks. Show it once, and it can replay the steps anytime you ask.
Two Ways to Create Workflows
Record It (Recommended)
The easiest way — just demonstrate what you want:
- Click the "Record Workflow" button at the bottom of the search box
- Do the task as you normally would — click, type, navigate
- Stop recording when you're done
- Mole's AI cleans up the recording: removes accidental clicks, merges keystrokes, and marks customizable parts (like search terms)
- The workflow is saved and ready to use
Next time, just say something like "run my check-in workflow" and Mole replays it.
Write It by Hand (Advanced)
For more control, you can write workflows as JSON definitions. This is useful for complex automations or sharing workflows with others. See the technical reference below.
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:
{
"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": "cdp_input",
"note": "Wait for results to load",
"params": {
"action": "wait_for_element",
"selector": ".results",
"timeout_ms": 10000
}
},
{
"action": "cdp_dom",
"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")
Recording Workflows
The easiest way to create a custom workflow is to record it directly in the floating ball. Instead of writing JSON by hand, just demonstrate the operation and let AI generate the workflow for you.
Steps
- Open the floating ball search box (
Cmd+M/Ctrl+M) - Click the "Record Workflow" button in the footer area
- Perform the operation on the page (click, type, navigate, etc.)
- Click "Stop" when done
- Optionally click on the result element, or click "Skip" for full-page snapshot mode
- Wait for AI to process — it will clean up the recording, remove noise, identify parameters, and generate a standard workflow
- The workflow is saved automatically and can be invoked by AI in future conversations
TIP
Recorded workflows are marked with source: "user" and stored alongside manually added and remote-synced workflows. You can manage them from the Options page.
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
{
"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.
