{
  "name": "Ultimate Browser Agent",
  "nodes": [
    {
      "parameters": {
        "resource": "extraction",
        "operation": "query",
        "sessionId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Session_ID', \"The `sessionId` returned by the `Start_Browser` tool\", 'string') }}",
        "windowId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Window_ID', \"The `windowId` returned by the `Start_Browser` tool\", 'string') }}",
        "prompt": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt', ``, 'string') }}",
        "additionalFields": {}
      },
      "id": "85338306-5acd-4e9b-9a02-7fc5e9a03557",
      "name": "Query",
      "type": "n8n-nodes-base.airtopTool",
      "position": [
        0,
        480
      ],
      "typeVersion": 1,
      "credentials": {
        "airtopApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "window",
        "operation": "load",
        "sessionId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Session_ID', \"The `sessionId` returned by the `Start_Browser` tool\", 'string') }}",
        "windowId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Window_ID', \"The `windowId` returned by the `Start_Browser` tool\", 'string') }}",
        "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', ``, 'string') }}",
        "additionalFields": {}
      },
      "id": "67cee508-c2c0-423e-b1fb-576de026f3ed",
      "name": "Load URL",
      "type": "n8n-nodes-base.airtopTool",
      "position": [
        120,
        480
      ],
      "typeVersion": 1,
      "credentials": {
        "airtopApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "interaction",
        "operation": "type",
        "sessionId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Session_ID', \"The `sessionId` returned by the `Start_Browser` tool\", 'string') }}",
        "windowId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Window_ID', \"The `windowId` returned by the `Start_Browser` tool\", 'string') }}",
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Text', ``, 'string') }}",
        "pressEnterKey": true,
        "elementDescription": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Element_Description', `Search bars usually contain a placeholder that says \"search\"`, 'string') }}",
        "additionalFields": {}
      },
      "id": "e1bab1f8-8127-49a2-b3a3-f672c0687ed6",
      "name": "Type",
      "type": "n8n-nodes-base.airtopTool",
      "position": [
        -120,
        480
      ],
      "typeVersion": 1,
      "alwaysOutputData": true,
      "credentials": {
        "airtopApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "text": "=Watch your agent work!\n\n{{ $json.data.liveViewUrl }}",
        "otherOptions": {
          "includeLinkToWorkflow": false
        }
      },
      "id": "5bc4020c-f677-45c2-b9f6-dc6cf847df1e",
      "name": "Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        -40,
        700
      ],
      "typeVersion": 2.3,
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "profileName": "={{ $json.profile_name }}",
        "additionalFields": {}
      },
      "id": "c40e9b06-cac3-4714-b58b-4b60c978f321",
      "name": "Session",
      "type": "n8n-nodes-base.airtop",
      "position": [
        -400,
        700
      ],
      "typeVersion": 1,
      "credentials": {
        "airtopApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "resource": "window",
        "url": "={{ $('When Executed by Another Workflow').item.json.url }}",
        "getLiveView": true,
        "additionalFields": {}
      },
      "id": "fd8f9014-eff8-45c2-9483-0e6eda4a4979",
      "name": "Window",
      "type": "n8n-nodes-base.airtop",
      "position": [
        -220,
        700
      ],
      "typeVersion": 1,
      "credentials": {
        "airtopApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "0a0680af-39bd-4bc7-b9cd-84c1766c79a1",
              "name": "sessionId",
              "type": "string",
              "value": "={{ $('Session').item.json.sessionId }}"
            },
            {
              "id": "13940ee8-c1d4-4718-a7b4-176c44c097b7",
              "name": "windowId",
              "type": "string",
              "value": "={{ $('Window').item.json.data.windowId }}"
            },
            {
              "id": "a0f2005c-2cd2-4a8d-891b-a4759b72a124",
              "name": "output",
              "type": "string",
              "value": "Session and window created successfully"
            }
          ]
        },
        "options": {}
      },
      "id": "9e310e8c-910e-431f-9919-94a06eb2eca0",
      "name": "Return IDs",
      "type": "n8n-nodes-base.set",
      "position": [
        140,
        700
      ],
      "typeVersion": 3.4
    },
    {
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "url"
            },
            {
              "name": "profile_name"
            }
          ]
        }
      },
      "id": "a84101b9-165f-47f4-bbc4-8705abfb6e41",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -580,
        700
      ],
      "typeVersion": 1.1
    },
    {
      "parameters": {
        "name": "Start_Browser",
        "description": "Start a new browser session and window",
        "workflowId": {
          "__rl": true,
          "value": "YOUR WORKFLOW ID",
          "mode": "id"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {},
          "matchingColumns": [],
          "schema": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "id": "385c94f1-27b4-492b-8224-41d26dbb76b4",
      "name": "Start Browser",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "position": [
        -360,
        480
      ],
      "typeVersion": 2.1
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        -320,
        220
      ],
      "id": "fa8ea169-c98f-42a3-9f9d-fd1571999bf6",
      "name": "When chat message received"
    },
    {
      "parameters": {
        "operation": "terminate",
        "sessionId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Session_ID', \"The `sessionId` returned by the `Start_Browser` tool\", 'string') }}"
      },
      "id": "05262c94-fb9a-4a51-b1c6-8b4981888850",
      "name": "End Session",
      "type": "n8n-nodes-base.airtopTool",
      "position": [
        240,
        480
      ],
      "typeVersion": 1,
      "credentials": {
        "airtopApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "typeVersion": 1,
      "position": [
        -580,
        480
      ],
      "id": "f5ee84a5-4b42-4f8c-b43e-9f7d91e6e420",
      "name": "Think"
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "=# Overview\nYou are a smart, advanced web agent connected to tools that let you control a remote web browser. Your primary goal is to fulfill the human's request accurately and efficiently by interacting with web pages using your tools.\n\n## Tools\n\n### Start_Browser\n- Always begin with this tool.\n- It returns a `sessionId` and `windowId` which are **required** for all other tools.\n- You must include these IDs in every subsequent tool call.\n\n### Load URL\n- Loads a website in the browser window.\n- Pass the `sessionId`, `windowId`, and the desired URL (e.g., `\"https://www.bestbuy.com\"`).\n\n### Query\n- You don't have access to the browser screen but you can call this tool to get knowledge and hints of the current browser window.\n- Use this tool to retrieve information that the human asked for.\n\n### Click\n- Use this tool to click on elements like buttons.\n\n### Type\n- Use this to type text into a visible input field. This tool clicks Enter after typing the text so don't send [ENTER] commandes.\n\n### End Session\n- When the task is fully complete, use this tool to properly close the browser session.\n- You must ALWAYS USE THIS TOOL BEFORE RESPONDING TO THE HUMAN\n\n### Think\n- Use when you need to reflect on what you've done and think about what steps to take next\n\n\n## Important\n- Always think step-by-step. Use `Query` whenever you\u2019re unsure what\u2019s on the screen or what to click/type next.\n- You will NEVER need to login",
          "maxIterations": 20,
          "returnIntermediateSteps": false,
          "passthroughBinaryImages": true
        }
      },
      "id": "43e674dd-82e5-49b3-8e4d-f13793e5e6c9",
      "name": "Browser Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -140,
        220
      ],
      "retryOnFail": true,
      "typeVersion": 1.8,
      "waitBetweenTries": 5000
    },
    {
      "parameters": {
        "content": "# Browser Agent\n",
        "height": 240,
        "width": 760,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -400,
        140
      ],
      "id": "14a2d1f7-4011-4b93-935e-43d499b9bb90",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## Browser Tools\n",
        "height": 220,
        "width": 760,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -400,
        400
      ],
      "id": "a0688106-d098-43af-84ea-87cc1a9c55bd",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "## Think",
        "height": 220,
        "width": 260
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -680,
        400
      ],
      "id": "60b25dc0-5899-4333-a606-f974dbc57ef4",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "content": "## Model / Memory",
        "height": 240,
        "width": 260,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -680,
        140
      ],
      "id": "ab5fdf44-bfd6-49c1-a94a-d0dec9e34c95",
      "name": "Sticky Note3"
    },
    {
      "parameters": {
        "content": "",
        "height": 200,
        "width": 160,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        380,
        420
      ],
      "id": "a0b512b9-7a84-4eff-8c71-9907b3bc78dc",
      "name": "Sticky Note4"
    },
    {
      "parameters": {
        "content": "## Start Browser Tool",
        "height": 240,
        "width": 1040,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -680,
        640
      ],
      "id": "b7555d71-d4b9-4a74-8444-5932162fe18d",
      "name": "Sticky Note5"
    },
    {
      "parameters": {
        "model": "anthropic/claude-3.5-sonnet",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "typeVersion": 1,
      "position": [
        -640,
        240
      ],
      "id": "20cc49d8-d50a-4516-b20d-3ff747205511",
      "name": "3.5 Sonnet",
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        -540,
        240
      ],
      "id": "bb3e8424-cca2-4a89-a2db-e6e1c61c20a2",
      "name": "Memory"
    },
    {
      "parameters": {
        "resource": "interaction",
        "sessionId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Session_ID', \"The `sessionId` returned by the `Start_Browser` tool\", 'string') }}",
        "windowId": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Window_ID', \"The `windowId` returned by the `Start_Browser` tool\", 'string') }}",
        "elementDescription": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Element_Description', `Describe in detail the element to click on, e.g. The menu item \"about us\" at the top of the page`, 'string') }}",
        "additionalFields": {
          "waitForNavigation": "domcontentloaded"
        }
      },
      "id": "5e29189a-2b5a-4193-bff1-f4afe1c4b838",
      "name": "ClickTool",
      "type": "n8n-nodes-base.airtopTool",
      "position": [
        420,
        480
      ],
      "typeVersion": 1,
      "alwaysOutputData": true,
      "credentials": {
        "airtopApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "toolDescription": "Use this tool to click on an element",
        "method": "POST",
        "url": "=https://api.airtop.ai/api/v1/sessions/{{ $fromAI('sessionId') }}/windows/{{ $fromAI('windowId') }}/click",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "elementDescription",
              "value": "={{ $fromAI('elementDescription', `the element to click on in as much detail as possible`, 'string') }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequestTool",
      "typeVersion": 4.2,
      "position": [
        -240,
        480
      ],
      "id": "2e0d8ccf-5d00-421e-994d-2f12aeb90c36",
      "name": "Click",
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "# \ud83d\udee0\ufe0f Setup Guide\n### \ud83d\udc64 Author: [Nate Herk](https://www.youtube.com/@nateherk)\n\n### \ud83d\udd0c Steps to Connect:\n1. **Airtop Setup**  \n   - Visit [Airtop](https://www.airtop.ai/) to generate your API key and connect to the Airtop tools/nodes.  \n   - Set up a profile with credentials (if automating websites like X, \nLinkedIn, or Amazon).  \n   - Connect your profile in the Start Browser tool.\n   - \ud83d\udcb8 Use code **`NateHalfOff`** for **50% off Airtop for 3 months**.\n\n2. **OpenRouter API Key**  \n   - Go to [OpenRouter](https://openrouter.ai/) and generate your API key.  \n   - Paste this key into your **Chat Model** node in n8n.\n\n3. **Start Browser Tool Setup**  \n   - Link your **Start Browser workflow** to the **Start Browser Tool**:\n     - Either link it using the **ID method** (explained in the YouTube video).\n     - Or paste the **Start Browser Tool** workflow into a separate n8n workflow and link it directly.\n\n4. **(Optional) Live Agent Browser View**  \n   - Connect additional services like:\n     - [Slack](https://slack.com/)\n     - [Telegram](https://telegram.org/)\n     - [Gmail](https://mail.google.com/)\n   - This allows you to **receive a live browser link** while your agent is running automations.\n\n---\n\ud83d\udca1 Need help? Ask questions in the [AI Automation Society Community](https://www.skool.com/ai-automation-society/about) or check out Nate\u2019s [YouTube Tutorials](https://www.youtube.com/@nateherk) .\n",
        "height": 740,
        "width": 660
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1360,
        140
      ],
      "id": "471cc91e-e194-42af-91fa-4242c270b7cd",
      "name": "Sticky Note6"
    }
  ],
  "connections": {
    "Type": {
      "ai_tool": [
        [
          {
            "node": "Browser Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Query": {
      "ai_tool": [
        [
          {
            "node": "Browser Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Slack": {
      "main": [
        [
          {
            "node": "Return IDs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Window": {
      "main": [
        [
          {
            "node": "Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Session": {
      "main": [
        [
          {
            "node": "Window",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load URL": {
      "ai_tool": [
        [
          {
            "node": "Browser Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Session",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start Browser": {
      "ai_tool": [
        [
          {
            "node": "Browser Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Browser Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "End Session": {
      "ai_tool": [
        [
          {
            "node": "Browser Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Think": {
      "ai_tool": [
        [
          {
            "node": "Browser Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Browser Agent": {
      "main": [
        []
      ]
    },
    "3.5 Sonnet": {
      "ai_languageModel": [
        [
          {
            "node": "Browser Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Memory": {
      "ai_memory": [
        [
          {
            "node": "Browser Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "ClickTool": {
      "ai_tool": [
        []
      ]
    },
    "Click": {
      "ai_tool": [
        [
          {
            "node": "Browser Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ce8ba148-75f0-4b8a-9498-0899bb38df20",
  "meta": {
    "templateId": "3592",
    "templateCredsSetupCompleted": true
  },
  "id": "M7oOZ03MG7k97cOe",
  "tags": []
}