Automation library · Chat assistants

Route and categorize Gmail emails to Slack with Llama

Started by an arriving email, and works across Gmail and Slack. It hands the judgement calls to OpenRouter. 18 steps, 2 branches: a working afternoon to understand properly.

MediumCalls a model: OpenRouter

18 stepsMedium: a working afternoon
2Branches: places the flow splits
0Loops or waits
2Services it connects to

The flow

Starts it 1Model 4Logic 7Service 6

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

  1. 1OpenRouter Chat ModelLm Chat Open RouterModel
  2. 2OpenRouter Chat Model1Lm Chat Open RouterModel
  3. 3Capture Gmail EventGmail triggerStarts it
  4. 4Find CategoryAgentModel
  5. 5Structured Output ParserOutput Parser StructuredModel
  6. 6Filter + Deduplicate ValidationCodeLogic
  7. 7Merge CategorySetLogic
  8. 8Check Data ExistIfLogic
  9. 9Get Channels ListSlackService
  10. 10Arrange Email DataSetLogic
  11. 11Format Channel DataCodeLogic
  12. 12Remove Duplicate Channel + Find Matched ChannelCodeLogic
  13. 13Check Channel ExistIfLogic
  14. 14Join Slack ChannelSlackService
  15. 15Create Slack ChannelSlackService
  16. 16Post Message in ChannelSlackService
  17. 17Invite a user to a channelSlackService
  18. 18Post Message in Created ChannelSlackService

How it's built

Starts on
An arriving email
Steps
18, with 2 branches
Size
Medium: a working afternoon
Connects to
Gmail, Slack
Model
OpenRouter

Questions

What does it need to run?

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

What starts it?

It starts on an arriving email.

Does it use AI?

Yes. It calls OpenRouter. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Plan an afternoon. 18 steps is enough that you should read each one before running it.

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 18 steps before you point it at anything that matters.