v0.8.0 - Custom Scripts
- Adds new Run Custom Script operation
Introducing the new Run Custom Script operation, which allows you to write and execute your own custom Puppeteer scripts directly within the node.
Capabilities:
-
Access to core Puppeteer objects:
$browser
and$page
, enabling complete control over browser automation tasks. -
Utilize
$input
,$json
, or$items
to reference incoming workflow data, allowing you to adapt the script to the current workflow context. -
Supports full use of Puppeteer's API, enabling advanced scenarios such as custom page interactions, data extraction, and conditional logic.
Example Use Case: Navigate to an IP lookup page, extract the IP address, and return it as part of the workflow output:
// Navigate to an IP lookup service
await $page.goto('https://httpbin.org/ip');
// Extract the IP address from the page content
const ipData = await $page.evaluate(() => {
const response = document.body.innerText;
const parsed = JSON.parse(response);
return parsed.origin; // Extract the 'origin' field, which typically contains the IP address
});
// Return the result in the required format
return [{ ip: ipData }];