references / workflows.md
Use this for a known sequence on one page. Inspect selectors and expected results first. Generate the JSON in the scratchpad, then run:
| Type | Fields and behavior |
|---|---|
fill | selector, text. Focus and select the existing text, then use native CDP input. Empty text clears it. Supports text, search, email, URL, telephone inputs and textareas. Rejects readonly, disabled, password and other input types. |
click | selector. Scroll into view, check the center is unobscured, then dispatch native mouse press/release. |
wait-for | selector, optional exact visible text, ( default or ), (default 5000, maximum 15000). Polls reads only. Hidden also matches an absent node; text cannot accompany hidden. |
references / workflows.md
Use this for a known sequence on one page. Inspect selectors and expected results first. Generate the JSON in the scratchpad, then run:
| Type | Fields and behavior |
|---|---|
fill | selector, text. Focus and select the existing text, then use native CDP input. Empty text clears it. Supports text, search, email, URL, telephone inputs and textareas. Rejects readonly, disabled, password and other input types. |
click | selector. Scroll into view, check the center is unobscured, then dispatch native mouse press/release. |
wait-for | selector, optional exact visible text, ( default or ), (default 5000, maximum 15000). Polls reads only. Hidden also matches an absent node; text cannot accompany hidden. |
statevisiblehiddentimeoutMsread | selector, optional limit (default 4000, maximum 10000 characters). Returns visible text and an explicit truncated flag. Does not read input values. |
checkpoint | label up to 160 characters. Adds a progress label after earlier steps finish; pair it with a preceding verification wait. |
Selectors must match one element, including hidden matches when checking ambiguity. Frames and shadow roots require separate targeted CDP work. There are no navigation steps: a detected document or URL change stops subsequent steps. Inspect the new page before continuing. URL-stable SPA changes still need meaningful application checks.
A file contains only steps, with 1–100 steps and a maximum size of 64 KiB. Unknown fields and invalid selectors fail before input dispatch. Dynamic element existence is checked when each step runs. The default deadline is 30 seconds; --timeout-ms accepts 1–120000 milliseconds. Results and checkpoints together are limited to 12000 UTF-8 bytes; split larger jobs. Individual reads may be truncated; an exhausted aggregate budget fails the batch.
For repeated rows, generate the sequence locally instead of spelling out dozens of model tool calls. For example, after inspecting the row IDs and confirming that these edits are authorized:
Success returns status: "completed", completedSteps, explicitly requested results, checkpoints, and durationMs. Completion means the instructions finished, not that the application persisted data; choose a wait/read that establishes the intended outcome.
Failure exits with status 1 and returns status: "failed", the completed count, one-based failedStep (0 for preflight), a bounded error, and retained results/checkpoints. outcomeUnknown: true means the failing step began input dispatch, so it may have taken effect. Even when false, earlier completed writes may have effects. Validation or connection failures before execution print a compact error to stderr instead.
There is no rollback or automatic write retry. Read current state and reconcile before submitting a smaller follow-up. User interaction can race automation; avoid simultaneous editing during a batch. An input event being acknowledged does not prove a server save completed.
Token savings come from local repetition and selective output. Existing single-action receipts are already small; do not claim a fixed savings percentage, especially when comparing with an already-focused eval workflow.
node <skill-folder>/scripts/cdp.mjs run --target-id '<id-from-list>' --file '<scratchpad>/workflow.json'
{
"steps": [
{ "type": "fill", "selector": "#display-name", "text": "Example" },
{ "type": "click", "selector": "#save" },
{ "type": "wait-for", "selector": "#status", "text": "Saved" },
{ "type": "checkpoint", "label": "Name saved" },
{ "type": "read", "selector": "#status", "limit": 500 }
]
}
statevisiblehiddentimeoutMsread | selector, optional limit (default 4000, maximum 10000 characters). Returns visible text and an explicit truncated flag. Does not read input values. |
checkpoint | label up to 160 characters. Adds a progress label after earlier steps finish; pair it with a preceding verification wait. |
Selectors must match one element, including hidden matches when checking ambiguity. Frames and shadow roots require separate targeted CDP work. There are no navigation steps: a detected document or URL change stops subsequent steps. Inspect the new page before continuing. URL-stable SPA changes still need meaningful application checks.
A file contains only steps, with 1–100 steps and a maximum size of 64 KiB. Unknown fields and invalid selectors fail before input dispatch. Dynamic element existence is checked when each step runs. The default deadline is 30 seconds; --timeout-ms accepts 1–120000 milliseconds. Results and checkpoints together are limited to 12000 UTF-8 bytes; split larger jobs. Individual reads may be truncated; an exhausted aggregate budget fails the batch.
For repeated rows, generate the sequence locally instead of spelling out dozens of model tool calls. For example, after inspecting the row IDs and confirming that these edits are authorized:
Success returns status: "completed", completedSteps, explicitly requested results, checkpoints, and durationMs. Completion means the instructions finished, not that the application persisted data; choose a wait/read that establishes the intended outcome.
Failure exits with status 1 and returns status: "failed", the completed count, one-based failedStep (0 for preflight), a bounded error, and retained results/checkpoints. outcomeUnknown: true means the failing step began input dispatch, so it may have taken effect. Even when false, earlier completed writes may have effects. Validation or connection failures before execution print a compact error to stderr instead.
There is no rollback or automatic write retry. Read current state and reconcile before submitting a smaller follow-up. User interaction can race automation; avoid simultaneous editing during a batch. An input event being acknowledged does not prove a server save completed.
Token savings come from local repetition and selective output. Existing single-action receipts are already small; do not claim a fixed savings percentage, especially when comparing with an already-focused eval workflow.
node <skill-folder>/scripts/cdp.mjs run --target-id '<id-from-list>' --file '<scratchpad>/workflow.json'
{
"steps": [
{ "type": "fill", "selector": "#display-name", "text": "Example" },
{ "type": "click", "selector": "#save" },
{ "type": "wait-for", "selector": "#status", "text": "Saved" },
{ "type": "checkpoint", "label": "Name saved" },
{ "type": "read", "selector": "#status", "limit": 500 }
]
}
import { writeFileSync } from 'node:fs';
const steps = [];
for (let index = 1; index <= 20; index += 1) {
steps.push({ type: 'fill', selector: `#row-${index}`, text: `Label ${index}` });
}
steps.push(
{ type: 'click', selector: '#save' },
{ type: 'wait-for', selector: '#status', text: 'Saved 20 rows' },
{ type: 'read', selector: '#status', limit: 500 },
);
writeFileSync('/absolute/scratchpad/workflow.json', JSON.stringify({ steps }));
import { writeFileSync } from 'node:fs';
const steps = [];
for (let index = 1; index <= 20; index += 1) {
steps.push({ type: 'fill', selector: `#row-${index}`, text: `Label ${index}` });
}
steps.push(
{ type: 'click', selector: '#save' },
{ type: 'wait-for', selector: '#status', text: 'Saved 20 rows' },
{ type: 'read', selector: '#status', limit: 500 },
);
writeFileSync('/absolute/scratchpad/workflow.json', JSON.stringify({ steps }));