# Build AI agents with OpenRouter: n8n workflow template

> Started by another system calling it. It calls services over plain HTTP rather than through connectors. It hands the judgement calls to OpenRouter.

Source: https://millionrounds.com/workflow/build-ai-agents-with-openrouter (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)

# Build AI agents with OpenRouter

Started by another system calling it. It calls services over plain HTTP rather than through connectors. It hands the judgement calls to OpenRouter. 26 steps: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenRouter

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fbuild-ai-agents-with-openrouter)

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

**0** Branches: places the flow splits

**0** Loops or waits

**0** Services by connector: it calls them over plain HTTP

## The flow

Starts it 2 Model 20 Logic 4

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

- 1 **OpenRouter Chat Model** Lm Chat Open Router *Model*
- 2 **Structured Output Parser** Output Parser Structured *Model*
- 3 **OpenRouter Chat Model1** Lm Chat Open Router *Model*
- 4 **OpenRouter Chat Model4** Lm Chat Open Router *Model*
- 5 **OpenRouter Chat Model5** Lm Chat Open Router *Model*
- 6 **Structured Output Parser1** Output Parser Structured *Model*
- 7 **start-thinking** Webhook *Starts it*
- 8 **OpenRouter Chat Model2** Lm Chat Open Router *Model*
- 9 **Structured Output Parser2** Output Parser Structured *Model*
- 10 **OpenRouter Chat Model3** Lm Chat Open Router *Model*
- 11 **OpenRouter Chat Model6** Lm Chat Open Router *Model*
- 12 **OpenRouter Chat Model7** Lm Chat Open Router *Model*
- 13 **Structured Output Parser3** Output Parser Structured *Model*
- 14 **get-weather** Webhook *Starts it*
- 15 **Act** Agent *Model*
- 16 **Task Output Parser** Output Parser Autofixing *Model*
- 17 **Think** Agent *Model*
- 18 **Thinking output parser** Output Parser Autofixing *Model*
- 19 **Config** Code *Logic*
- 20 **Act1** Agent *Model*
- 21 **Task Output Parser1** Output Parser Autofixing *Model*
- 22 **Think1** Agent *Model*
- 23 **Thinking output parser1** Output Parser Autofixing *Model*
- 24 **Config1** Code *Logic*
- 25 **No Operation, do nothing** No Op *Logic*
- 26 **Code** Code *Logic*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 26
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Nothing by connector; it calls services over plain HTTP
- **Model:** OpenRouter

## Questions

What does it need to run?

An n8n account, and a key for OpenRouter. 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 OpenRouter. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 26 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 26 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%2Fbuild-ai-agents-with-openrouter)
- **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.

## Workflows like it

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

- [**Auto categorise Outlook emails with a local model** 26 steps · calls a model · Outlook](https://millionrounds.com/workflow/auto-categorise-outlook-emails-with-a-local-model)
- [**Auto categorise Outlook emails with a local model** 26 steps · calls a model · Outlook](https://millionrounds.com/workflow/auto-categorise-outlook-emails-with-a-local-model-2)
- [**Build a Headless AI Chat API with Memory and History** 26 steps · calls a model · n8n data table](https://millionrounds.com/workflow/build-a-headless-ai-chat-api-with-memory-and-history)
- [**Email-to-task automation with Outlook and Microsoft To Do** 26 steps · calls a model · Gmail, Google Tasks](https://millionrounds.com/workflow/email-to-task-automation-with-outlook-and-microsoft-to-do)
- [**Generate LinkedIn carousel images from text with Mistral** 26 steps · calls a model · Google Drive, S3](https://millionrounds.com/workflow/generate-linkedin-carousel-images-from-text-with-mistral)
- [**The ultimate Instagram automation for high-quality images & text** 26 steps · calls a model · Google Cloud Storage](https://millionrounds.com/workflow/the-ultimate-instagram-automation-for-high-quality-images-an)
