# Route IAM events with OpenAI and Slack: n8n workflow template

> Started by another system calling it, and works across Gmail and n8n data table. It puts OpenAI behind a retrieval step, so answers are drawn from documents...

Source: https://millionrounds.com/workflow/route-iam-events-with-openai-and-slack (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [AI assistants](https://millionrounds.com/workflows?category=AI+assistants#library)

# Route IAM events with OpenAI and Slack

Started by another system calling it, and works across Gmail and n8n data table. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 21 steps, 1 branch: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Froute-iam-events-with-openai-and-slack)

**21 steps** Large: read it before trusting it with anything live

**1** Branch: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 2 Model 7 Logic 4 Service 8

The steps in the order they run, from what starts it.

- 1 **Receive IAM Event** Webhook *Starts it*
- 2 **Governance Model** Lm Chat Open Ai *Model*
- 3 **Conversation Memory** Memory Buffer Window *Model*
- 4 **Access Signal Model** Lm Chat Open Ai *Model*
- 5 **Governance Output Parser** Output Parser Structured *Model*
- 6 **Validation Output Parser** Output Parser Structured *Model*
- 7 **forgeLLM API Tool** Http Request Tool *Service*
- 8 **Slack Notification Tool** Slack Tool *Service*
- 9 **Email Notification Tool** Gmail Tool *Service*
- 10 **Audit Log Tool** Data Table Tool *Service*
- 11 **Compliance Query Tool** Data Table Tool *Service*
- 12 **Governance Agent** Agent *Model*
- 13 **Access Signal Agent** Agent Tool *Model*
- 14 **Route by Decision** Switch *Logic*
- 15 **Prepare Approved Data** Set *Logic*
- 16 **Store Revoked Events** Data Table *Service*
- 17 **Prepare Revoked Data** Set *Logic*
- 18 **Store Escalated Events** Data Table *Service*
- 19 **Prepare Escalated Data** Set *Logic*
- 20 **Store Approved Events** Data Table *Service*
- 21 **Return Response** Respond To Webhook *Starts it*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 21, with 1 branch
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, n8n data table
- **Model:** OpenAI
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Gmail account, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on another system calling it.

Does it use AI?

Yes. It calls OpenAI. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 21 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 21 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Froute-iam-events-with-openai-and-slack)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Gmail](https://millionrounds.com/workflows?service=Gmail#library)[n8n data table](https://millionrounds.com/workflows?service=n8n+data+table#library)

## Workflows like it

Also ai assistants, with the same services where possible, closest in size first.

- [**Agile project generator with ClickUp and OpenAI** 21 steps · calls a model · ClickUp, Gmail](https://millionrounds.com/workflow/agile-project-generator-with-clickup-and-openai)
- [**Design and apply Gmail label systems with OpenAI** 21 steps · calls a model · Gmail](https://millionrounds.com/workflow/design-and-apply-gmail-label-systems-with-openai)
- [**Parse Gmail inbox and transform into Todoist tasks with OpenAI** 21 steps · calls a model · Email, Gmail](https://millionrounds.com/workflow/parse-gmail-inbox-and-transform-into-todoist-tasks-with-open)
- [**Retrieve and answer Gmail email queries with Llama and Qdrant** 21 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/retrieve-and-answer-gmail-email-queries-with-llama-and-qdran)
- [**Turn HR news into policy update tasks and a weekly Gmail digest** 21 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/turn-hr-news-into-policy-update-tasks-and-a-weekly-gmail-dig)
- [**Validate academic promotion decisions with OpenAI and Gmail** 21 steps · calls a model · Email, n8n data table](https://millionrounds.com/workflow/validate-academic-promotion-decisions-with-openai-and-gmail)
