Skip to content

Commit c33c57b

Browse files
author
Cowork 3P
committed
docs: add number type, fix n8n node structure, correct SDK ordering
1 parent b3cb501 commit c33c57b

8 files changed

Lines changed: 222 additions & 77 deletions

File tree

src/content/docs/developer-guide/worker-definition/input-schema.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,3 +327,4 @@ Developers can logically group multiple configuration items by using specific fi
327327
1. **Write clear descriptions**: Make sure `description` is clear and accurate. This helps your script get discovered by more target users.
328328
2. **Set sensible defaults**: A reasonable `default` value lets users run the script immediately and greatly lowers the barrier to entry.
329329
3. **Validate required fields**: For parameters without which the script cannot run, such as login cookies or the main URL, be sure to set `"required": true`.
330+
4. **Max results naming**: If your Worker accepts a maximum-results parameter, use the field name `max_results`. This is the conventional name recognized by the platform and downstream integrations.

src/content/docs/developer-guide/worker-definition/output-schema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Each column definition contains the following properties:
4444
| Property | Required | Description |
4545
| -------------- | -------- | --------------------------------------------------------------------------------------------- |
4646
| **name** | Yes | Column identifier. Must match the key name used in `push_data`. Must be unique. |
47-
| **type** | Yes | Data type of the column. Supported values: `string`, `integer`, `boolean`, `array`, `object` |
47+
| **type** | Yes | Data type of the column. Supported values: `string`, `number`, `integer`, `boolean`, `array`, `object` |
4848
| **description**| No | Column description. Displayed as the column header label in the UI. |
4949

5050
## Relationship with SDK

src/content/docs/developer-guide/worker-definition/sdk-modules.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ res, err := coresdk.Result.SetTableHeader(ctx, headers)
185185
* **key**: Unique identifier used in code (recommended lowercase with underscores)
186186
* **format**: Data type, supported values:
187187
* `"text"`: String / text
188+
* `"number"`: Number (integer or float)
188189
* `"integer"`: Integer
189190
* `"boolean"`: Boolean (true / false)
190191
* `"array"`: List / array
@@ -237,7 +238,7 @@ for i, news := range newsData {
237238

238239
##### Important Notes
239240

240-
* Header definition and data pushing **can be done in either order**
241+
* Header definition **must be done before** the first data push
241242
* Data keys **must exactly match** the header keys (case-sensitive)
242243
* Data must be pushed **one record at a time**
243244
* Logging after each push is recommended

src/content/docs/integrations/workflows-and-notifications/n8n.md

Lines changed: 110 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ Use [n8n](https://n8n.io/) to build automated workflows that trigger CoreClaw Wo
99

1010
## How it works
1111

12-
The CoreClaw n8n integration provides a dedicated community node (`n8n-nodes-coreclaw`) with built-in actions for common operations:
12+
The CoreClaw n8n integration provides a dedicated community node (`n8n-nodes-coreclaw`) with four resources and built-in actions for common operations:
1313

14-
- **Start a Worker**Run any Worker from the CoreClaw Store
15-
- **Check run status**Poll execution progress
16-
- **Get results**Retrieve output data
17-
- **Abort a run**Cancel an in-progress execution
14+
- **Scraper**Search the marketplace, get scraper details, and run a scraper
15+
- **Run**Get status, get results, export results, get logs, abort, or rerun an execution
16+
- **Task**Run a pre-configured saved task
17+
- **Account**Get account info (balance, traffic, plan)
1818

1919
You can also use the **HTTP Request** node to call the CoreClaw REST API directly for advanced use cases.
2020

@@ -36,15 +36,15 @@ For n8n Cloud users, installation is straightforward — search and add the node
3636
2. Open the **nodes panel** (click the **+** button on the canvas).
3737
3. Search for **CoreClaw** in the community node registry.
3838

39-
Search for CoreClaw node in n8n
39+
![Search for CoreClaw node in n8n](@/assets/docs/n8n-1.png)
4040

41-
1. Click **Install node** to add the CoreClaw node to your instance.
41+
4. Click **Install node** to add the CoreClaw node to your instance.
4242

43-
Install n8n-nodes-coreclaw package
43+
![Install n8n-nodes-coreclaw package](@/assets/docs/n8n-2.png)
4444

4545
After installation, you can find the CoreClaw node under **Community Nodes** in the nodes panel.
4646

47-
CoreClaw node in Community Nodes list
47+
![CoreClaw node in Community Nodes list](@/assets/docs/n8n-3.png)
4848

4949
### Create credentials
5050

@@ -53,14 +53,14 @@ Before using the CoreClaw node, you need to create a credential with your CoreCl
5353
1. In n8n, go to **Credentials****Add Credential**.
5454
2. Search for **CoreClaw API** and select it.
5555

56-
Create CoreClaw API credential
56+
![Create CoreClaw API credential](@/assets/docs/n8n-4.png)
5757

58-
1. Enter a name for the credential (e.g., "CoreClaw Production").
59-
2. In the **API Key** field, paste the API key you copied from the [CoreClaw Console](https://console.coreclaw.com/settings/integrations).
58+
3. Enter a name for the credential (e.g., "CoreClaw Production").
59+
4. In the **API Key** field, paste the API key you copied from the [CoreClaw Console](https://console.coreclaw.com/settings/integrations).
6060

61-
Enter API key and save credential
61+
![Enter API key and save credential](@/assets/docs/n8n-5.png)
6262

63-
1. Click **Save** to store the credential.
63+
5. Click **Save** to store the credential.
6464

6565
You can now use this credential in any CoreClaw node in your workflows.
6666

@@ -87,59 +87,130 @@ Follow the same steps as [Create credentials](#create-credentials) above to set
8787

8888
## CoreClaw node actions
8989

90-
The CoreClaw node provides several built-in actions for common operations.
90+
The CoreClaw node is organized by **resource** (Scraper, Run, Task, Account). Select a resource, then choose the operation you want to perform.
9191

92-
### Start a Worker
92+
### Scraper resource
9393

94-
Run any Worker from the CoreClaw Store.
94+
#### Search
9595

96+
Search the CoreClaw marketplace for ready-to-run scrapers by keyword.
97+
98+
| Field | Description |
99+
| ------- | ---------------------------------------------------------------------- |
100+
| **Query** | Keyword matched against scraper title / description / tags |
101+
| **Limit** | Max number of results to return (1–100, default: 50) |
102+
103+
#### Get Details
104+
105+
Fetch the full spec of a scraper: current version, system defaults, custom input schema, and README.
106+
107+
| Field | Description |
108+
| -------------- | ---------------------------------------------------------------------- |
109+
| **Scraper** | Pick from the marketplace list, or paste a slug directly |
110+
111+
#### Run
112+
113+
Start an asynchronous scraper run with custom parameters.
96114

97115
| Field | Description |
98116
| -------------------- | ------------------------------------------------------------------------ |
99-
| **Worker Slug** | The unique identifier of the Worker (e.g., `01KNXSHE0Y7DZKF1N8B1EMFX35`) |
100-
| **Version** | The Worker version to run (leave empty for latest) |
101-
| **Input Parameters** | Worker-specific input fields (varies by Worker) |
102-
| **Proxy Region** | Optional proxy region for the run |
117+
| **Scraper** | Pick from the marketplace list, or paste a slug directly |
118+
| **Version** | Scraper version string (required). Obtain from **Get Details** → version |
119+
| **Custom Parameters**| Scraper-specific input parameters as JSON (schema from Get Details) |
120+
| **System Parameters**| Optional JSON overrides for cpus, memory, timeout, max charge, traffic |
103121
| **Callback URL** | Optional webhook URL for async notifications |
104122

123+
:::caution
124+
**Version is required.** The node does not support "leave empty for latest". Always obtain the correct version string from **Get Details** first.
125+
:::
105126

106127
Get the `scraper_slug` (Worker Slug) from the Worker page in the [CoreClaw Console](https://console.coreclaw.com/store) or from the API (`GET /api/scraper?slug=<scraper_slug>`).
107128

108-
### Check Run Status
129+
### Run resource
109130

110-
Poll the status of a running or completed Worker execution.
131+
#### Get
111132

133+
Get the current execution status of a run (status, started_at, duration, cost).
112134

113135
| Field | Description |
114136
| ------------ | -------------------------------------------------- |
115-
| **Run Slug** | The run identifier returned when starting a Worker |
116-
137+
| **Run Slug** | The run identifier returned when starting a scraper or task |
117138

118139
Status codes: `1` Ready, `2` Running, `3` Succeeded, `4` Failed, `5` Aborting.
119140

120-
### Get Results
141+
#### Get Many
142+
143+
List the user's historical scraper runs with pagination and filters.
144+
145+
| Field | Description |
146+
| -------------- | --------------------------------------------------- |
147+
| **Return All** | Whether to return all results or only up to a limit |
148+
| **Limit** | Max number of results to return (1–200, default: 50) |
149+
| **Filters** | Filter by status and/or scraper slug |
121150

122-
Retrieve the output data from a completed run.
151+
#### Get Results
123152

153+
Get paginated result records from a completed run.
124154

125-
| Field | Description |
126-
| -------------- | ---------------------------------------- |
127-
| **Run Slug** | The run identifier |
128-
| **Page Index** | Page number for pagination (default: 1) |
129-
| **Page Size** | Number of results per page (default: 20) |
155+
| Field | Description |
156+
| -------------- | --------------------------------------------------- |
157+
| **Run Slug** | The run identifier |
158+
| **Return All** | Whether to return all results or only up to a limit |
159+
| **Limit** | Max number of results to return (1–500, default: 50)|
130160

161+
#### Export Results
131162

132-
For large datasets, use the **Export Results** action to download a JSON or CSV file.
163+
Export a run's full result set as a downloadable CSV or JSON file.
133164

134-
### Abort a Run
165+
| Field | Description |
166+
| -------------- | ---------------------------------------------------------------------- |
167+
| **Run Slug** | The run identifier |
168+
| **Format** | `csv` (human-readable, opens in Excel) or `json` (preserves nesting) |
169+
| **Filter Keys**| Comma-separated field keys to include. Leave empty for all fields. |
135170

136-
Cancel an in-progress Worker execution.
171+
#### Get Logs
137172

173+
Fetch execution logs from a run for debugging or understanding failures.
174+
175+
| Field | Description |
176+
| ------------ | --------------------------- |
177+
| **Run Slug** | The run identifier |
178+
179+
#### Abort
180+
181+
Cancel an in-progress scraper run.
138182

139183
| Field | Description |
140184
| ------------ | --------------------------- |
141185
| **Run Slug** | The run identifier to abort |
142186

187+
#### Rerun
188+
189+
Re-run a previous run with the exact same parameters.
190+
191+
| Field | Description |
192+
| -------------- | ---------------------------------------------------------------------- |
193+
| **Run Slug** | The run identifier to rerun |
194+
| **Callback URL**| Optional webhook URL for async notifications |
195+
196+
### Task resource
197+
198+
#### Run
199+
200+
Run a pre-configured saved task from the CoreClaw console. Task parameters are stored with the task itself, so no custom input is needed.
201+
202+
| Field | Description |
203+
| -------------- | ---------------------------------------------------------------------- |
204+
| **Task Slug** | Saved task identifier from the CoreClaw Console → Tasks page |
205+
| **Callback URL**| Optional webhook URL for async notifications |
206+
207+
### Account resource
208+
209+
#### Get Info
210+
211+
Get account info: balance, traffic usage, and plan expiry.
212+
213+
No parameters required.
143214

144215
---
145216

@@ -148,13 +219,13 @@ Cancel an in-progress Worker execution.
148219
Here's a typical n8n workflow using CoreClaw:
149220

150221
1. **Trigger** — Schedule Trigger (e.g., every day at 9 AM) or Webhook
151-
2. **CoreClaw: Start a Worker** — Run a web scraper with target URLs
222+
2. **CoreClaw: Scraper → Run** — Run a web scraper with target URLs
152223
3. **Wait** — Wait 30 seconds for the run to progress
153-
4. **CoreClaw: Check Run Status** — Poll until status is `3` (Succeeded)
224+
4. **CoreClaw: Run → Get** — Poll until status is `3` (Succeeded)
154225
5. **IF** — Check if status equals `3`
155226
- **True** → Continue to get results
156227
- **False** → Loop back to Wait
157-
6. **CoreClaw: Get Results** — Retrieve the scraped data
228+
6. **CoreClaw: Run → Get Results** — Retrieve the scraped data
158229
7. **Downstream nodes** — Send to Google Sheets, Slack, database, etc.
159230

160231
---
@@ -165,7 +236,6 @@ For operations not covered by the CoreClaw node, use the **HTTP Request** node t
165236

166237
### Configuration
167238

168-
169239
| Field | Value |
170240
| ----------------- | ------------------------------------------------ |
171241
| Method | `POST` (most endpoints) |
@@ -175,10 +245,8 @@ For operations not covered by the CoreClaw node, use the **HTTP Request** node t
175245
| Header Value | Your CoreClaw API key |
176246
| Body Content Type | `JSON` |
177247

178-
179248
### Common endpoints
180249

181-
182250
| Action | Method | Endpoint |
183251
| ----------------------- | ------ | ---------------------------------- |
184252
| Get Worker schema | `GET` | `/api/scraper?slug=<scraper_slug>` |
@@ -189,7 +257,6 @@ For operations not covered by the CoreClaw node, use the **HTTP Request** node t
189257
| Export results (file) | `POST` | `/api/v1/run/result/export` |
190258
| Abort a run | `POST` | `/api/v1/scraper/abort` |
191259

192-
193260
Full API reference: [API Integration](/api/integration/).
194261

195262
---
@@ -212,8 +279,6 @@ Full API reference: [API Integration](/api/integration/).
212279
2. Check **Settings → Community Nodes** — the node should be listed there.
213280
3. If using n8n Cloud, ensure verified community nodes are enabled in the Cloud Admin Panel.
214281

215-
216-
217282
**Invalid API key error**
218283

219284
1. Verify the API key in the [CoreClaw Console](https://console.coreclaw.com/settings/integrations).
@@ -229,8 +294,6 @@ curl -X POST "https://openapi.coreclaw.com/api/v1/account/info" \
229294

230295
A successful response contains `code: 0`.
231296

232-
233-
234297
**Worker-specific input fields**
235298

236299
Each Worker has different input parameters. To find the correct fields:
@@ -246,5 +309,4 @@ Or call the API:
246309
curl "https://openapi.coreclaw.com/api/scraper?slug=YOUR_SCRAPER_SLUG"
247310
```
248311

249-
The response contains `data.parameters.custom.properties` — each entry maps to an input field.
250-
312+
The response contains `data.parameters.custom.properties` — each entry maps to an input field.

src/content/docs/zh-cn/developer-guide/worker-definition/input-schema.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,3 +329,4 @@ sidebar:
329329
1. **清晰的提示**:description 务必清晰准确,这将有利于您的脚本被更多目标用户检索到。
330330
2. **设置默认值**:合理的 default 可以让用户直接点击运行,极大地降低使用门槛。
331331
3. **校验必填**:对于没有它脚本就无法运行的参数(如登录 Cookie、主链接),一定要设置 `"required": true`
332+
4. **最大结果数命名**:如果 Worker 需要限制最大返回条数,字段名应使用 `max_results`。这是平台及下游集成所识别的标准命名。

src/content/docs/zh-cn/developer-guide/worker-definition/output-schema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ sidebar:
4444
| 属性 | 是否必填 | 说明 |
4545
| -------------- | -------- | ---------------------------------------------------------- |
4646
| **name** || 列标识符。必须与 `push_data` 中使用的键名一致。必须唯一。 |
47-
| **type** || 列的数据类型。支持:`string``integer``boolean``array``object` |
47+
| **type** || 列的数据类型。支持:`string``number``integer``boolean``array``object` |
4848
| **description**|| 列描述。在 UI 中作为列标题标签显示。 |
4949

5050
## 与 SDK 的关系

src/content/docs/zh-cn/developer-guide/worker-definition/sdk-modules.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ res, err := coresdk.Result.SetTableHeader(ctx, headers)
185185
* **key**:代码中使用的唯一标识(建议小写+下划线)
186186
* **format**:数据类型,支持以下值:
187187
* `"text"`:字符串/文本
188+
* `"number"`:数值(整数或浮点数)
188189
* `"integer"`:整数
189190
* `"boolean"`:布尔值(true / false)
190191
* `"array"`:列表/数组
@@ -237,7 +238,7 @@ for i, news := range newsData {
237238

238239
##### 注意事项
239240

240-
* 表头定义和数据推送**顺序不限**
241+
* 表头定义**必须在第一次推送数据之前完成**
241242
* 数据的 key **必须与表头 key 完全一致**(区分大小写)
242243
* 数据必须**逐条推送**
243244
* 建议每次推送后记录日志

0 commit comments

Comments
 (0)