Playwright icon

Playwright

Control browser using Playwright directly with CDP URL

Wait For Timeout

AI-generated

Overview

This node allows you to control a Chromium-based browser using the Playwright library by connecting directly via a Chrome DevTools Protocol (CDP) URL. The "Wait For Timeout" operation specifically pauses the workflow execution for a specified duration in milliseconds. This can be useful when you need to introduce deliberate delays between browser automation steps, such as waiting for animations to complete or throttling requests.

Practical example:
If you are automating a web scraping task and want to wait 5 seconds after loading a page before proceeding to the next step, you would use this operation with a duration of 5000 ms.

Properties

Name Meaning
CDP URL The WebSocket URL to connect to the browser's Chrome DevTools Protocol endpoint.
Duration (Ms) The amount of time in milliseconds to wait before continuing execution.

Output

The output JSON contains a single field:

  • operation: A string indicating the performed operation, which will be "waitForTimeout" for this operation.

No additional data or binary output is produced by this operation.

Example output JSON:

{
  "operation": "waitForTimeout"
}

Dependencies

  • Requires a running Chromium-based browser instance accessible via a Chrome DevTools Protocol WebSocket URL.
  • Uses the Playwright library to connect and control the browser.
  • No internal credentials are required beyond providing the CDP URL.
  • Ensure that the CDP URL is valid and reachable from the environment where n8n runs.

Troubleshooting

  • Common issues:
    • Invalid or unreachable CDP URL: The node will fail to connect if the provided URL is incorrect or the browser is not running with remote debugging enabled.
    • Timeout errors if the browser connection is slow or unstable.
  • Error messages:
    • Unsupported operation: waitForTimeout — This should not occur if the operation is correctly set; otherwise, verify the operation parameter.
    • Connection errors related to the CDP URL usually indicate network or browser configuration problems.
  • Resolutions:
    • Verify the browser is launched with remote debugging enabled (e.g., --remote-debugging-port=9222).
    • Confirm the CDP URL matches the active browser instance.
    • Check network connectivity and firewall settings.

Links and References

Discussion