Overview
The Close Browser node terminates the browser instance and cleans up all associated resources. This node is typically used at the end of a workflow or when you need to restart the browser with different settings.Browser instances are automatically closed when a workflow completes, so this node is optional in most cases.
When to Use
Use the Close Browser node when:- You need to restart the browser with different settings mid-workflow
- You want to explicitly clean up resources before a long-running operation
- You’re running multiple browser sessions and need to close specific ones
- You want to ensure all browser data is cleared between workflow steps
Behavior
When executed, this node:- Closes all open tabs and windows
- Terminates the browser process
- Cleans up temporary files and cache
- Releases all browser context references
Configuration
The Close Browser node has no configuration parameters. It automatically detects and closes the active browser instance from the workflow context.Examples
Basic Usage
Restart Browser Pattern
- Workflow
- JSON
Error Handling
The Close Browser node handles common error scenarios:- No browser running: Silently succeeds (no-op)
- Browser already closed: Silently succeeds (no-op)
- Force close on timeout: After 30 seconds, forcefully terminates the browser process
Implementation Details
The node is implemented by:- Retrieving the PlaywrightManager from the execution context
- Calling the cleanup methods on all browser contexts
- Closing the browser instance
- Clearing context references
The browser close operation is asynchronous and waits for graceful shutdown. If the browser doesn’t respond within 30 seconds, it’s forcefully terminated.
Best Practices
Notes
After closing the browser, you must use a new Start Browser node to perform additional browser operations.
Related Nodes
- Start Browser - Launch browser instance
- Navigate - Browser navigation
