{
  "name": "Spot workplace discrimination patterns with AI",
  "nodes": [
    {
      "id": "b508ab50-158a-4cbf-a52e-f53e1804e770",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        280,
        380
      ]
    },
    {
      "id": "11a1a2d5-a274-44f7-97ca-5666a59fcb31",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2220,
        800
      ]
    },
    {
      "id": "395f7b67-c914-4aae-8727-0573fdbfc6ad",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2220,
        380
      ]
    },
    {
      "id": "6ab194a9-b869-4296-aea9-19afcbffc0d7",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        2940,
        600
      ]
    },
    {
      "id": "1eba1dd7-a164-4c70-8c75-759532bd16a0",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        3840,
        420
      ]
    },
    {
      "id": "f25f1b07-cded-4ca7-9655-8b8f463089ab",
      "name": "SET company_name",
      "type": "n8n-nodes-base.set",
      "position": [
        540,
        380
      ]
    },
    {
      "id": "87264a93-ab97-4e39-8d40-43365189f704",
      "name": "Define dictionary of demographic keys",
      "type": "n8n-nodes-base.set",
      "position": [
        740,
        380
      ]
    },
    {
      "id": "862f1c77-44a8-4d79-abac-33351ebb731b",
      "name": "ScrapingBee Search Glassdoor",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        940,
        380
      ]
    },
    {
      "id": "4c9bf05e-9c50-4895-b20b-b7c329104615",
      "name": "Extract company url path",
      "type": "n8n-nodes-base.html",
      "position": [
        1140,
        380
      ]
    },
    {
      "id": "d20bb0e7-4ca7-41d0-a3e9-41abc811b064",
      "name": "ScrapingBee GET company page contents",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1340,
        380
      ]
    },
    {
      "id": "fce70cab-8ce3-4ce2-b040-ce80d66b1e62",
      "name": "Extract reviews page url path",
      "type": "n8n-nodes-base.html",
      "position": [
        1540,
        380
      ]
    },
    {
      "id": "d2e7fee9-e3d4-42bf-8be6-38b352371273",
      "name": "ScrapingBee GET Glassdoor Reviews Content",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1760,
        380
      ]
    },
    {
      "id": "0c322823-0569-4bd5-9c4e-af3de0f8d7b4",
      "name": "Extract Overall Review Summary",
      "type": "n8n-nodes-base.html",
      "position": [
        1980,
        260
      ]
    },
    {
      "id": "851305ba-0837-4be9-943d-7282e8d74aee",
      "name": "Extract Demographics Module",
      "type": "n8n-nodes-base.html",
      "position": [
        1980,
        520
      ]
    },
    {
      "id": "cf9a6ee2-53b5-4fbf-a36c-4b9dab53b795",
      "name": "Extract overall ratings and distribution percentages",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        2200,
        200
      ]
    },
    {
      "id": "ae164f6e-04e7-4d8b-951e-a17085956f4b",
      "name": "Extract demographic distributions",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        2200,
        620
      ]
    },
    {
      "id": "c8d9e45c-7d41-47bd-b9a9-0fa70de5d154",
      "name": "Define contributions to variance",
      "type": "n8n-nodes-base.set",
      "position": [
        2560,
        200
      ]
    },
    {
      "id": "8ea03017-d5d6-46ef-a5f1-dae4372f6256",
      "name": "Set variance and std_dev",
      "type": "n8n-nodes-base.set",
      "position": [
        2740,
        200
      ]
    },
    {
      "id": "0570d531-8480-4446-8f02-18640b4b891e",
      "name": "Calculate P-Scores",
      "type": "n8n-nodes-base.code",
      "position": [
        3340,
        440
      ]
    },
    {
      "id": "0bdb9732-67ef-440d-bdd2-42c4f64ff6b6",
      "name": "Sort Effect Sizes",
      "type": "n8n-nodes-base.set",
      "position": [
        3540,
        440
      ]
    },
    {
      "id": "fd9026ef-e993-410a-87d6-40a3ad10b7a7",
      "name": "Calculate Z-Scores and Effect Sizes",
      "type": "n8n-nodes-base.set",
      "position": [
        3140,
        600
      ]
    },
    {
      "id": "85536931-839a-476b-b0dd-fa6d01c6d5c1",
      "name": "Format dataset for scatterplot",
      "type": "n8n-nodes-base.code",
      "position": [
        3340,
        760
      ]
    },
    {
      "id": "957b9f6c-7cf8-4ec6-aec7-a7d59ed3a4ad",
      "name": "Specify additional parameters for scatterplot",
      "type": "n8n-nodes-base.set",
      "position": [
        3540,
        760
      ]
    },
    {
      "id": "a937132c-43fc-4fa0-ae35-885da89e51d1",
      "name": "Quickchart Scatterplot",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3740,
        760
      ]
    },
    {
      "id": "ede1931e-bac8-4279-b3a7-5980a190e324",
      "name": "QuickChart Bar Chart",
      "type": "n8n-nodes-base.quickChart",
      "position": [
        3740,
        560
      ]
    },
    {
      "id": "6122fec0-619c-48d3-ad2c-05ed55ba2275",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        40
      ],
      "parameters": {
        "width": 3741.593083126444,
        "height": 1044.8111554136713,
        "content": "# Spot Workplace Discrimination Patterns using ScrapingBee, Glassdoor, OpenAI, and QuickChart\n"
      }
    },
    {
      "id": "5cda63e8-f31b-46f6-8cb2-41d1856ac537",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        900,
        180
      ],
      "parameters": {
        "width": 1237.3377621763516,
        "height": 575.9439659309116,
        "content": "## Use ScrapingBee to gather raw data from Glassdoor"
      }
    },
    {
      "id": "28d247b2-9020-4280-83d2-d6583622c0b7",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        920,
        240
      ],
      "parameters": {
        "width": 804.3951263154196,
        "height": 125.73173301324687,
        "content": "### Due to javascript restrictions, a normal HTTP request cannot be used to gather user-reported details from Glassdoor. \n\nInstead, [ScrapingBee](https://www.scrapingbee.com/) offers a great tool with"
      }
    },
    {
      "id": "d65a239c-06d2-470b-b24a-23ec00a9f148",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2180,
        99.69933502879758
      ],
      "parameters": {
        "width": 311.0523273992095,
        "height": 843.8786512173932,
        "content": "## Extract details with AI"
      }
    },
    {
      "id": "3cffd188-62a1-43a7-a67f-548e21d2b187",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2516.1138215303854,
        100
      ],
      "parameters": {
        "width": 423.41585047129973,
        "height": 309.71740416262054,
        "content": "### Calculate variance and standard deviation from review rating distributions."
      }
    },
    {
      "id": "b5015c07-03e3-47d4-9469-e831b2c755c0",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3320,
        706.46982689582
      ],
      "parameters": {
        "width": 639.5579220386832,
        "height": 242.80759628871897,
        "content": "## Formatting datasets for Scatterplot"
      }
    },
    {
      "id": "e52bb9d9-617a-46f5-b217-a6f670b6714c",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        120
      ],
      "parameters": {
        "width": 356.84794255678776,
        "height": 186.36110628732342,
        "content": "## How this workflow works\n1. Replace ScrapingBee and OpenAI credentials\n2. Replace company_name with company of choice (workflow performs better with larger US-based organizations)\n3. Preview QuickCh"
      }
    },
    {
      "id": "d83c07a3-04ed-418f-94f1-e70828cba8b2",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        880
      ],
      "parameters": {
        "width": 356.84794255678776,
        "height": 181.54335665904924,
        "content": "### Inspired by [Wes Medford's Medium Post](https://medium.com/@wryanmedford/an-open-letter-to-twilios-leadership-f06f661ecfb4)\n\nWes performed the initial data analysis highlighting problematic behavi"
      }
    },
    {
      "id": "ed0c1b4a-99fe-4a27-90bb-ac38dd20810b",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4020,
        880
      ],
      "parameters": {
        "width": 847.5931795867759,
        "height": 522.346478008115,
        "content": "![image](https://quickchart.io/chart?c=%7B%0A%20%20%22type%22%3A%20%22scatter%22%2C%0A%20%20%22data%22%3A%20%7B%0A%20%20%20%20%22datasets%22%3A%20%5B%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20"
      }
    },
    {
      "id": "7b92edf8-3a58-4931-abf4-d9c2f57cfa32",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3980,
        800
      ],
      "parameters": {
        "width": 989.7621518164046,
        "height": 636.6345107975716,
        "content": "## Example Scatterplot output"
      }
    },
    {
      "id": "bd6859b4-096c-401e-9bce-91e970e1afd1",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2540,
        800
      ],
      "parameters": {
        "width": 737.6316136259719,
        "height": 444.9087184962878,
        "content": "## Glossary\n**Z-Score** – A statistical measure that indicates how many standard deviations a data point is from the mean. In this analysis, a negative z-score suggests a group rates their workplace e"
      }
    },
    {
      "id": "5af3ef87-ed4b-481e-b1ba-d44ffb7551d8",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4140,
        80
      ],
      "parameters": {
        "width": 643.5995639515581,
        "height": 646.0030521944287,
        "content": "## Example AI Analysis (Twilio Example)\n\n### Key Takeaways\n1. **Significant Disparity Among Disabled Employees**\nDisabled employees reported the lowest average ratings, with a z-score of -5.50, indica"
      }
    },
    {
      "id": "a39cdbe7-d6ae-4a84-98c7-52ebf98242f3",
      "name": "Text Analysis of Bias Data",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        3720,
        280
      ]
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Calculate Z-Scores and Effect Sizes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SET company_name": {
      "main": [
        [
          {
            "node": "Define dictionary of demographic keys",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Text Analysis of Bias Data",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Sort Effect Sizes": {
      "main": [
        [
          {
            "node": "QuickChart Bar Chart",
            "type": "main",
            "index": 0
          },
          {
            "node": "Text Analysis of Bias Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate P-Scores": {
      "main": [
        [
          {
            "node": "Sort Effect Sizes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Extract demographic distributions",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Extract overall ratings and distribution percentages",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Extract company url path": {
      "main": [
        [
          {
            "node": "ScrapingBee GET company page contents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set variance and std_dev": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Demographics Module": {
      "main": [
        [
          {
            "node": "Extract demographic distributions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ScrapingBee Search Glassdoor": {
      "main": [
        [
          {
            "node": "Extract company url path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract reviews page url path": {
      "main": [
        [
          {
            "node": "ScrapingBee GET Glassdoor Reviews Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Overall Review Summary": {
      "main": [
        [
          {
            "node": "Extract overall ratings and distribution percentages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format dataset for scatterplot": {
      "main": [
        [
          {
            "node": "Specify additional parameters for scatterplot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Define contributions to variance": {
      "main": [
        [
          {
            "node": "Set variance and std_dev",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract demographic distributions": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "SET company_name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Z-Scores and Effect Sizes": {
      "main": [
        [
          {
            "node": "Calculate P-Scores",
            "type": "main",
            "index": 0
          },
          {
            "node": "Format dataset for scatterplot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Define dictionary of demographic keys": {
      "main": [
        [
          {
            "node": "ScrapingBee Search Glassdoor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ScrapingBee GET company page contents": {
      "main": [
        [
          {
            "node": "Extract reviews page url path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ScrapingBee GET Glassdoor Reviews Content": {
      "main": [
        [
          {
            "node": "Extract Demographics Module",
            "type": "main",
            "index": 0
          },
          {
            "node": "Extract Overall Review Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Specify additional parameters for scatterplot": {
      "main": [
        [
          {
            "node": "Quickchart Scatterplot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract overall ratings and distribution percentages": {
      "main": [
        [
          {
            "node": "Define contributions to variance",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}