---
title: Navigation
description: Run the flow when a tab is created, navigated to a matching URL, or closed.
---

Run a workflow when a browser tab is opened, moves to a matching address, or is closed.

## What it does

The trigger listens to three tab events. Pick any of them in **Events**:

* **Created**: a new tab opens.
* **Navigated** (the default): a tab's address changes. It fires as soon as the browser reports the new address, before the page has finished loading.
* **Closed**: a tab is closed.

For **Created** and **Navigated**, the tab's address must also match one of the **URL Patterns**. **Closed** ignores the patterns: a closed tab has no address to check, so every closed tab fires it.

Each matching event runs the workflow once, from this trigger.

## When to use it

* Run something whenever you go to a site, without waiting for the page to load.
* Count or log the tabs you open and close.
* Clean up when a tab closes, for example clear a value you stored for it.

If you need the page content, use [Page Load](/nodes/builtin/trigger/pageload/) instead: it waits until the page has finished loading.

## Inputs and settings

Patterns use the form `scheme://host/path` with `*` as a wildcard, for example `https://mail.google.com/*` or `https://*.example.com/*`. `<all_urls>` matches every web page. See [Page Load](/nodes/builtin/trigger/pageload/#inputs-and-settings) for more examples.

A new tab often opens before it has an address, so **Created** with a narrow pattern may not fire. Use **Navigated** to catch the moment the tab reaches the site.

## Outputs

Each output item has these fields:

```json title="Shape of an output item"
{
  "triggerType": "navigation",
  "triggeredAt": "…",
  "event": "…",
  "url": "…",
  "title": "…",
  "tabId": 0,
  "windowId": 0
}
```

`event` tells you what happened: `created`, `updated` (shown as **Navigated** in the settings) or `removed` (**Closed**). `url`, `title` and `windowId` describe the tab; for a closed tab only `tabId` is set.

## Dependencies and credentials

None. This node needs no connection and has no slots for other nodes.

## Example workflow

Count how many times a day you open your inbox:

1. Add **Navigation** with **Events** set to **Navigated** and **URL Patterns** `https://mail.google.com/*`.
2. Add [Data Store](/nodes/builtin/core/datastore/) with **Operation** **Increment**, **Key** `inbox-visits` and **Increment By** `1`.
3. Activate the workflow and open your inbox.

## Common issues

* **It fires several times for one visit.** A site that redirects, or changes its address while loading, reports several address changes. Narrow the patterns to the final address, or use [Page Load](/nodes/builtin/trigger/pageload/), which fires once per completed load.
* **It does not fire when a web app changes view.** Some web apps change the visible page without the browser reporting a new address to extensions. Use [Element Change](/nodes/builtin/trigger/elementchange/) to watch the page content instead.
* **Closed fires for every tab.** That is expected: a closed tab has no address, so patterns cannot filter it. Use an [IF](/nodes/builtin/flow/if/) node on `tabId` if you only care about certain tabs.
* **Nothing happens.** Check that the workflow is activated and that at least one event is selected. This node runs in the browser extension; install it and activate the workflow there.

## Related nodes

* [Page Load](/nodes/builtin/trigger/pageload/): fire once a matching page has finished loading.
* [Element Change](/nodes/builtin/trigger/elementchange/): fire when part of a page changes.
* [Tab Control](/nodes/extension/tabcontrol/): open, focus or close tabs.