Spot Workplace Discrimination Patterns with AI n8n Workflow Template

n8n workflow template · 26 nodes · OpenAI

Spot Workplace Discrimination Patterns with AI is a free n8n workflow template that starts when you run it manually in the n8n editor and works with OpenAI and QuickChart. It has 26 nodes, 6 of them AI nodes (OpenAI Chat Model, Information Extractor and Basic LLM Chain). To run it, you add your own credentials for HTTP Query Auth and OpenAI API.

At a glance

Trigger
Manual Trigger (When clicking ‘Test workflow’)
Nodes
26
Apps
OpenAI and QuickChart
AI nodes
6
Credentials
2 types
Category
AI agents and LLM tools

Apps and integrations

  • OpenAI
  • QuickChart

Node types used

  • Manual Trigger
  • OpenAI Chat Model
  • Merge
  • Edit Fields (Set)
  • HTTP Request
  • HTML
  • Information Extractor
  • Code
  • QuickChart
  • Basic LLM Chain

How it works

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

Spot Workplace Discrimination Patterns using ScrapingBee, Glassdoor, OpenAI, and QuickChart

Inspired by Wes Medford's Medium Post

Wes performed the initial data analysis highlighting problematic behaviors at Twilio. I wanted to try and democratize the data analysis they performed for those less technical.

Use ScrapingBee to gather raw data from Glassdoor

Due to javascript restrictions, a normal HTTP request cannot be used to gather user-reported details from Glassdoor.

Instead, ScrapingBee offers a great tool with a very generous package of free tokens per month, which works out to roughly 4-5 runs of this workflow.

Extract details with AI

Calculate variance and standard deviation from review rating distributions.

Glossary

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 experience lower than the average, while a positive z-score suggests a better-than-average experience.

Effect Size – A measure of the magnitude of difference between groups. Larger negative effect sizes indicate a more substantial disparity in workplace experiences for certain groups, making it useful for identifying meaningful gaps beyond just statistical significance.

P-Score (P-Value) – The probability that the observed differences occurred by chance. A lower p-score (typically below 0.05) suggests the difference is statistically significant and unlikely to be random. In this analysis, high p-scores confirm that the disparities in ratings for marginalized groups are unlikely to be due to chance alone.

Relevance to This Analysis

These metrics help quantify workplace disparities among demographic groups. Z-scores show which groups report better or worse experiences, effect sizes reveal the severity of these differences, and p-scores confirm whether the disparities are statistically meaningful. This data allows for a more informed discussion about workplace equity and areas needing improvement.

Formatting datasets for Scatterplot

%20%7B%0A%20%20%20%20%20%20%20%20%20%20var%20idx%20%3D%20context.dataIndex%3B%0A%20%20%20%20%20%20%20%20%20%20return%20context.chart.data.labels%5Bidx%5D%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A#full-width)

Example AI Analysis (Twilio Example)

Key Takeaways

  1. Significant Disparity Among Disabled Employees

Disabled employees reported the lowest average ratings, with a z-score of -5.50, indicating a far worse experience compared to their non-disabled peers.

  1. LGBTQIA Community's Challenges

Members of the LGBTQIA community showed significantly lower ratings (z-score of -2.53), suggesting they may experience a workplace environment that is less inclusive or supportive compared to others.

  1. Transgender Experiences Are Particularly Negative

Transgender employees rated their experiences considerably lower (z-score of -2.91), highlighting a critical area for improvement in workplace culture and acceptance.

  1. Veterans Report Higher Satisfaction

In contrast, veterans had the highest ratings (z-score of 1.54), which could indicate a supportive environment or programs tailored to their needs.

  1. Overall Gender Discrepancies

A noticeable gap exists in average ratings by gender, with female employees scoring below male employees, suggesting potential gender biases or challenges in workplace dynamics.

Employee Experiences

Perceptions of Workplace Environment

For members of groups reporting significantly worse experiences, such as disabled, transgender, and LGBTQIA employees, the workplace may feel alienating or unwelcoming. These individuals might perceive that their contributions are undervalued or overlooked and that necessary support systems are lacking, creating a culture of exclusion rather than one of inclusivity. This feeling of being marginalized can lead to poorer engagement, higher turnover rates, and diminished overall job satisfaction, adversely impacting both employees and the organization.

Setup notes

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

How this workflow works

  1. Replace ScrapingBee and OpenAI credentials
  2. Replace company_name with company of choice (workflow performs better with larger US-based organizations)
  3. Preview QuickChart data visualizations and AI data analysis

Nodes in this workflow

The 26 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:

  1. When clicking ‘Test workflow’ (Manual Trigger)
  2. OpenAI Chat Model1 (OpenAI Chat Model)
  3. OpenAI Chat Model2 (OpenAI Chat Model)
  4. Merge (Merge)
  5. OpenAI Chat Model (OpenAI Chat Model)
  6. SET company_name (Edit Fields (Set))
  7. Define dictionary of demographic keys (Edit Fields (Set))
  8. ScrapingBee Search Glassdoor (HTTP Request)
  9. Extract company url path (HTML)
  10. ScrapingBee GET company page contents (HTTP Request)
  11. Extract reviews page url path (HTML)
  12. ScrapingBee GET Glassdoor Reviews Content (HTTP Request)
  13. Extract Overall Review Summary (HTML)
  14. Extract Demographics Module (HTML)
  15. Extract overall ratings and distribution percentages (Information Extractor)
  16. Extract demographic distributions (Information Extractor)
  17. Define contributions to variance (Edit Fields (Set))
  18. Set variance and std_dev (Edit Fields (Set))
  19. Calculate P-Scores (Code)
  20. Sort Effect Sizes (Edit Fields (Set))
  21. Calculate Z-Scores and Effect Sizes (Edit Fields (Set))
  22. Format dataset for scatterplot (Code)
  23. Specify additional parameters for scatterplot (Edit Fields (Set))
  24. Quickchart Scatterplot (HTTP Request)
  25. QuickChart Bar Chart (QuickChart)
  26. Text Analysis of Bias Data (Basic LLM Chain)

Credentials you need

  • HTTP Query Auth – used by ScrapingBee GET Glassdoor Reviews Content, ScrapingBee GET company page contents and ScrapingBee Search Glassdoor
  • OpenAI API – used by OpenAI Chat Model, OpenAI Chat Model1 and OpenAI Chat Model2

Configure your own credentials after importing. Create each credential in n8n, then select it in the node.

How to import into n8n

  1. Download the JSON file with the button above.
  2. In n8n, open a new workflow, select the ... menu and choose Import from File. You can also paste the JSON straight into the editor canvas.
  3. Open each node that shows a warning and select or create its credential.
  4. Read the notes on the canvas, test the workflow with sample data, then activate it.

Do you need somewhere to run it? Read our guide to self-hosted n8n.

Need this customised?

We can adapt this workflow to your apps, data and process, then deploy and support it.

Contact Us