{
  "name": "09 - Playwright MCP Agent",
  "nodes": [
    {
      "parameters": {
        "content": "## 09 Playwright MCP Agent\nWe have: a chat message like \"log in as locked_out_user\".\nWe get: a real browser run, then RESULT: PASS or FAIL with evidence.\n\n1. Terminal: npx @playwright/mcp@latest --port 8931\n2. Add your OpenAI credential and open Chat.\n\nn8n in Docker: use http://host.docker.internal:8931/mcp and start MCP with --host 0.0.0.0 --allowed-hosts \"*\"",
        "height": 240,
        "width": 480
      },
      "id": "09000000-0000-4000-8000-000000000000",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -60,
        -300
      ]
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "09000000-0000-4000-8000-000000000001",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        0,
        0
      ],
      "webhookId": "0b2c3d4e-0909-4a2b-9c3d-7e8f9a0b1c09"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.chatInput }}",
        "options": {
          "systemMessage": "You test the TTACart web app in a real browser.\nApp: https://app.thetestingacademy.com/playwright/ttacart/\nUsers (password tta_secret): standard_user, locked_out_user, error_user\n\n1. Open the app and call browser_snapshot before you click or type.\n2. Do only the steps asked.\n3. Check the result on the page.\n\nEnd with:\nRESULT: PASS or FAIL\nEVIDENCE: the exact text you saw",
          "maxIterations": 30
        }
      },
      "id": "09000000-0000-4000-8000-000000000002",
      "name": "Browser Test Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        240,
        0
      ]
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "id": "09000000-0000-4000-8000-000000000003",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        180,
        220
      ]
    },
    {
      "parameters": {
        "endpointUrl": "http://localhost:8931/mcp",
        "serverTransport": "httpStreamable",
        "options": {
          "timeout": 60000
        }
      },
      "id": "09000000-0000-4000-8000-000000000004",
      "name": "Playwright MCP",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "typeVersion": 1.1,
      "position": [
        360,
        220
      ]
    }
  ],
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "Browser Test Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Browser Test Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Playwright MCP": {
      "ai_tool": [
        [
          {
            "node": "Browser Test Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "active": false
}
