Mindsurf icon

Mindsurf

Playwright-based web browser automation for n8n

Overview

The Mindsurf node provides a comprehensive Playwright-based web browser automation tool within n8n. It enables users to programmatically control browsers (Chromium, Firefox, WebKit) for a wide range of tasks such as navigating web pages, capturing screenshots or PDFs, interacting with page elements, executing JavaScript in the page context, waiting for specific conditions, managing network behavior, handling storage (cookies, local/session storage), accessibility auditing, file uploads/downloads, tab and window management, AI-powered browser automation, profile and proxy management, and session handling.

This node is beneficial for automating complex web workflows, scraping data, testing websites, performing repetitive browser tasks, or integrating browser actions into larger automation pipelines.

Practical examples:

  • Navigate to a URL and take a full-page screenshot.
  • Fill out and submit a form by interacting with input fields.
  • Extract text content or attributes from page elements using JavaScript evaluation.
  • Wait for specific elements to appear before proceeding.
  • Manage cookies or local storage to maintain session state.
  • Use AI commands to automate browser actions based on natural language instructions.
  • Save and load browser sessions to preserve login states across executions.

Properties

Name Meaning
Browser Which browser to use: Chromium, Firefox, or WebKit.
Operation Category The category of operation to perform. Options include Navigation, Screenshot & PDF, Interaction, Evaluate, Wait, Network, Storage, Accessibility, File, Tab, AI, Profile, Proxy, Session.
Navigation Operation Specific navigation action: Go To URL, Go Back, Go Forward, Reload, Wait for Navigation.
URL The URL to navigate to (used with Go To URL).
Wait Until When to consider navigation complete: Load event, DOM Content Loaded, Network Idle, Commit.
Timeout Maximum time to wait for navigation or other operations (in milliseconds).
Screenshot Operation Screenshot-related actions: Take Screenshot, Take Element Screenshot, Generate PDF.
Selector CSS selector for targeting elements (e.g., for element screenshot, interaction, evaluation).
Screenshot Options Options for screenshots including full page capture, image type (PNG/JPEG), quality, background omission, animation control, caret visibility, scale, and clipping area.
PDF Options Options for PDF generation such as scale, header/footer display, print background, orientation, page ranges, paper format, margins, and accessibility tags.
Output Property Name Name of the binary property where screenshot or PDF data will be stored.
Interaction Operation Actions to interact with page elements: Click, Double Click, Right Click, Type Text, Fill, Clear, Select Option, Check/Uncheck, Hover, Focus, Press Key, Upload File, Drag and Drop, Scroll, Tap, Swipe.
Text Text to type or fill into an element.
Key Keyboard key or combination to press (e.g., Enter, Escape).
File Path Path to file for upload operations.
Select Value Values or labels to select in dropdowns (comma-separated for multiple).
Check State Whether to check or uncheck a checkbox.
Source Selector Selector for drag source element.
Target Selector Selector for drop target element.
Scroll Direction Direction to scroll: Down, Up, Left, Right, or To Element.
Scroll Distance Number of pixels to scroll.
Scroll Target Element selector to scroll to (when direction is To Element).
Swipe Direction Direction to swipe on mobile: Up, Down, Left, Right.
Swipe Distance Distance in pixels to swipe.
Click Options Detailed click options including mouse button, click count, delay, position, force click, trial mode, timeout, error handling strategies, modifiers keys, and whether to wait after click.
Type Options Options for typing text such as delay between keystrokes, key to press after typing, timeout, and wait behavior.
Evaluate Operation JavaScript evaluation actions: Execute JS, get element text, attribute, property, element details, page content, URL, title, count elements, check existence, visibility, enabled state, checked state.
JavaScript Code JavaScript code to execute in the page context.
Attribute Name Attribute name to retrieve from an element.
Property Name Property name to retrieve from an element.
Arguments Arguments to pass to the JavaScript function during evaluation.
Polling Polling method for waiting during evaluation: None, RAF, Mutation, Interval.
Polling Interval Interval in milliseconds for polling when using interval polling.
Extract Options Options for extracting multiple elements: extract all, limit, include selector, selector path strategy.
Wait Operation Waiting actions: Wait for selector, load state, function, timeout, request, response, event, file chooser, popup, download.
State Element state to wait for: Attached, Detached, Visible, Hidden.
Load State Page load state to wait for: Load, DOM Content Loaded, Network Idle.
Function JavaScript function to evaluate for wait conditions.
Delay Time to wait in milliseconds.
URL Pattern URL pattern to match for request/response waits.
Predicate Function Function to match requests/responses.
Event Name Page event to wait for: Close, Console, Dialog, Download, File Chooser, Frame events, Load, Page Error, Popup, Request events, Worker.
Polling (Wait) Polling method for waitForFunction: RAF, Mutation, Interval.
Polling Interval (Wait) Interval in milliseconds for polling during waitForFunction.
Strict Whether to throw error if multiple elements match selector during wait.
Network Operation Network control actions: Set headers, user agent, offline mode, cache, authenticate, route, abort, continue, fulfill requests, emulate network conditions, block resources, set request interception.
Extra Headers JSON object of extra HTTP headers to set.
User Agent User agent string to set.
Offline Enable or disable offline mode.
Cache Enabled Enable or disable cache.
Authentication HTTP authentication credentials (username/password).
URL Pattern (Network) URL pattern to match for routing, aborting, continuing, or fulfilling requests.
Route Handler How to handle routed requests: Abort, Continue, Fulfill, Fallback.
Abort Error Code Error code to use when aborting requests.
Continue Options Overrides for continued requests: URL, method, headers, post data.
Fulfill Options Response overrides for fulfilled requests: status, headers, content type, body, file path.
Network Conditions Parameters to emulate network conditions: offline, download/upload throughput, latency.
Resource Types Resource types to block: Document, Stylesheet, Image, Media, Font, Script, Text Track, XHR, Fetch, Event Source, WebSocket, Manifest, Other.
Interception Enabled Enable or disable request interception.
Storage Operation Storage management actions: Get/Set/Delete Cookies, Clear Cookies, Get/Set/Remove/Clear Local Storage, Get/Set/Remove/Clear Session Storage, Save/Load Storage State.
Cookie Name Name of cookie to delete.
Cookie Cookie properties to set: name, value, domain, path, expires, httpOnly, secure, sameSite.
Storage Key Key for local/session storage item.
Storage Value Value for local/session storage item.
Storage File Path File path to save/load storage state.
Cookie Filter Filters for getting cookies by name, domain, path, or URL.
Return All Cookies Whether to return all cookies or filtered subset.
Accessibility Operation Accessibility actions: Get tree, snapshot, check role/label, run audit, get ARIA attributes, keyboard navigation test, get focus order.
Include Children Include children nodes in accessibility tree/snapshot.
Interesting Only Include only interesting nodes in accessibility snapshot.
Root Selector Root element selector for accessibility tree.
Audit Options Options for accessibility audit: include warnings/notices, standards to check, ignore rules.
Focus Test Keyboard navigation tests: tab, arrow keys, enter, escape, max elements.
Return Format Format for accessibility audit results: JSON, HTML report, plain text, CSV.
File Operation File handling actions: Upload, Download, Handle Download, Save Download, Set Download Path, Accept/Cancel File Chooser, Get Downloads.
File Selector Selector for file input element.
Upload File Path Path to file to upload.
Multiple Files Comma-separated paths for multiple files.
Download URL URL of file to download.
Download Selector Selector for download link.
Download Path Directory path for downloads.
File Name Filename for saved download.
Download Options Options for download: wait for completion, timeout, custom filename.
File Chooser Options Options for accepting file chooser dialog: wait behavior, timeout.
Download Filter Filters for downloaded files by extension, name pattern, size, date.
Return Binary Data Whether to return file content as binary data.
Binary Property Name Name of binary property to store file data.
Tab Operation Tab/window management: New Tab, Close Tab, Switch Tab, Get Tabs, Bring to Front, New Window, Close Window, Get Windows, Minimize, Maximize, Fullscreen, Set Window Bounds.
Tab URL URL to open in new tab/window.
Tab Index Index of tab (0-based).
Tab ID ID of tab.
Use Current Tab Whether to use current active tab.
Window Options Window size and position options for new windows.
Window Bounds Window bounds for setting position and size.
Fullscreen Mode Fullscreen mode actions: Enter, Exit, Toggle.
Tab Options Options for opening new tabs: wait until event, timeout, background.
Include Info Information to include about tabs/windows: URL, Title, ID, Index, Active, Viewport.
Force Close Force close without waiting for beforeunload event.
AI Operation AI-powered browser automation: Execute JSON command, Extract page context, Parse LLM response, Build LLM prompt, Get command documentation.
JSON Command JSON command to execute for AI operation (navigate, click, type, screenshot, scroll, wait, hover, select, check, press, doubleClick, rightClick).
LLM Response Raw LLM response text containing JSON command to parse.
User Command Natural language command from user for building LLM prompt.
Include Page Context Whether to include current page context in LLM prompt.
Include Commands in Prompt Whether to include command documentation in LLM prompt.
System Prompt Custom system prompt for LLM.
Execute Command Whether to execute parsed AI command immediately.
Profile Operation Profile management: Create, Load, Update, List, Delete, Export, Import, Clone profiles.
Profile Name Name for profile.
Profile ID ID of profile to operate on.
Profile Data Exported profile data to import.
Profile Metadata Additional metadata for profile.
Proxy Operation Proxy management: Add, Add list, List, Test, Remove, Get statistics, Import, Export proxies.
Proxy Server Proxy server URL.
Proxy Name Name for proxy configuration.
Proxy Credentials Username and password for proxy.
Proxy List List of proxies (one per line).
Proxy ID ID of proxy to operate on.
Proxy Location Location info for proxy: country, city, residential flag.
Import/Export File Path File path for proxy import/export.
File Format Format for proxy import/export: JSON or Text.
Session Operation Session management: Save, Load, List, Delete saved sessions; Close session(s); Cleanup all.
Profile Description Optional description for saved session.
Overwrite Existing Whether to overwrite existing session/profile with same name.
Create New Session Whether to create new session ID when loading profile.
Session ID Session ID to reuse browser context across executions.
Close Browser Whether to also close the browser when closing session.
Browser Options Browser launch options: headless, slow motion, timeout, viewport size, user agent, locale, timezone, geolocation, permissions, color scheme, extra HTTP headers, offline mode, HTTP credentials, ignore HTTPS errors, JavaScript enabled, CSP bypass, user data directory, downloads path, device scale factor, mobile/touch support, reduced motion, forced colors, proxy settings.

Output

The node outputs an array of items, each containing:

  • json: An object with the result of the executed operation. This may include:

    • Operation-specific data such as navigation status, extracted text or attributes, accessibility audit results, profile or proxy information, session details, etc.
    • The current page URL (url) and title (title) if available.
    • The session ID used for the browser context (sessionId).
    • Additional metadata depending on the operation.
  • binary (optional): For operations that produce binary data (e.g., screenshots, PDFs, downloaded files), the output includes a binary property containing the file data under a configurable property name (default "data").

If an operation extracts multiple items (e.g., extracting all matching elements), multiple output items are returned, each representing one extracted element with relevant metadata.

In case of errors, if "Continue On Fail" is enabled, the output contains an item with an error field describing the issue.

Dependencies

  • Requires Playwright library for browser automation.
  • Needs appropriate API keys or credentials if using proxy servers or authenticated network requests.
  • May require file system access for file upload/download and profile import/export.
  • No internal credential names are exposed; users must provide necessary authentication tokens or API keys via n8n credentials or environment variables as applicable.
  • The node manages browser contexts and sessions internally but can reuse sessions via session IDs.

Troubleshooting

  • Common issues:

    • Navigation timeouts if the target URL is slow or unreachable.
    • Selector not found errors when interacting with elements that do not exist or are not visible.
    • Permission or CSP restrictions blocking script execution or resource loading.
    • File path errors when uploading or downloading files if paths are incorrect or inaccessible.
    • Session conflicts if session IDs are reused improperly.
    • Proxy connection failures due to invalid proxy settings or credentials.
  • Error messages:

    • Timeout errors indicate waiting for navigation, selectors, or functions exceeded configured limits. Increase timeout or verify page responsiveness.
    • Selector errors mean the specified CSS/XPath selector did not match any element. Verify selector correctness.
    • Authentication errors occur if HTTP or proxy credentials are invalid.
    • File system errors arise if file paths are invalid or permissions are insufficient.
  • Resolutions:

    • Adjust timeouts and verify URLs/selectors.
    • Ensure correct credentials and proxy configurations.
    • Confirm file paths and permissions.
    • Use "Continue On Fail" to handle recoverable errors gracefully.

Links and References

Discussion