Playwright API icon

Playwright API

Interact with Playwright API

Overview

The "Keep Alive" operation in the Playwright API node is designed to maintain an active browser session by preventing it from timing out or closing due to inactivity. This is useful in automation workflows where a long-running session needs to stay open while other tasks are performed intermittently, such as monitoring a webpage, waiting for user input, or performing periodic interactions.

Practical examples include:

  • Keeping a browser session alive during a multi-step web scraping process that takes time between steps.
  • Maintaining an authenticated session on a website to avoid re-login.
  • Preventing session expiration when running scheduled automated tests or interactions.

Properties

Name Meaning
Session ID ID of the session to keep alive

This property requires the user to specify the unique identifier of the existing browser session that should be kept active.

Output

The node outputs JSON data representing the result of the keep-alive action. Typically, this will confirm that the session remains active or provide status information related to the session's state.

No binary data output is associated with this operation.

Dependencies

  • Requires a valid and active browser session identified by the Session ID.
  • Needs an API authentication token configured in n8n credentials to interact with the Playwright API.
  • The Playwright environment must be properly set up and accessible by the node.

Troubleshooting

  • Common issues:

    • Providing an invalid or expired Session ID will cause errors because the session cannot be found or maintained.
    • Network or API connectivity problems may prevent the keep-alive signal from reaching the Playwright service.
    • Missing or incorrect API authentication credentials will block access to session management.
  • Error messages:

    • "The operation "keepAlive" is not supported!" — This indicates a misconfiguration or typo in the operation parameter; ensure "Keep Alive" is selected correctly.
    • Errors related to session not found or expired — Verify the Session ID is correct and the session is still active.
    • Authentication errors — Check that the required API key or token is properly configured in n8n credentials.

Links and References

Discussion