AI Builder with n8n – Create Agents and Voice Agents

Create Agents and Voice Agents

Out of all the courses I’ve made, this has to be the single most satisfying and gratifying. It actually feels like it’s CHEATING to create agents with n8n and ElevenLabs. Making substantial business impact simply shouldn’t be this easy.

Well, I’m here to show you that it IS this easy!

After three short but intensive weeks, you’ll be quite the expert. You’ll deploy agents that rebalance your equity portfolio, answer questions with a RAG knowledge base, and drive sales to your business all the way through to booking demos.

You’ll be positioned to build autonomous agents for yourself, your business and your clients that deliver significant value… in an insignificant amount of time.

It feels so productive and empowering to use n8n to build business solutions, that it feels more like entertainment than work – as you will see!

The Links

How much do I need to spend on n8n and APIs?

Absolutely nothing – everything we use on this course is free or optional. There are opportunities to spend if you have budget, but they are all optional.

There are 2 ways to run n8n:
n8n cloud: running on their infrastructure. This has a free trial period for at least 2 weeks, then a paid plan.
n8n self-hosted: free, running on your computer.

We start the course using n8n cloud to keep it simple, while you’re on the free trial. Then I show you how to use the free n8n self-hosted in week 3, if you wish.

We work with many APIs on this course, including different LLMs. They are all optional. Free models via OpenRouter can be used throughout, but please see the note about privacy settings in the Week 1 Day 1 section below. ElevenLabs has a free trial and it’s optional to use ElevenLabs.

The Resources

Resources for Week 1

Link to n8n cloud: https://n8n.io

Week 1 Day 1:
If you wish to use free models, then when you set up OpenRouter, you’ll need to go to this page:
https://openrouter.ai/settings/privacy
And set the following 2 fields to ON:
Enable free endpoints that may train on inputs
Enable free endpoints that may publish prompts

If you’d like more background on what LLMs actually are and how they work, please check out my set of 4 videos here.:

Week 1 Day 5:

If you’d rather not create the workflow from scratch, I’ve put an export of the full workflow in the Week 1 folder here; after you create the Workflow, click on the three-dots menu in the top right and select “Import from File”. You’ll need to update the credentials and email address.

If you’d like to create the full workflow yourself, here is the User Prompt that I use, so you can copy and paste:

You have access to the user's Equity portfolio which is in Google Sheet. You also have access to market data. The user has asked you to rebalance their portfolio with this instruction:
{{ $json["How would you like to rebalance your portfolio?"] }}
In order to achieve this:
1. Read the portfolio from the sheet
2. Fetch latest prices of the positions
3. Update the table with the prices
4. Make decisions on portfolio rebalancing
5. Update the table with portfolio rebalancing decisions
6. Read the table again to check the rebalancing achieved the objective
7. Make any further changes to improve rebalancing, updating the table
8. Finally, send an email with trading decisions and concise push notification

And here is the prompt I use:

This tool provides details of the user's portfolio in Google Sheet. This includes the positions and the equity / fixed income breakdown. Use this tool to retrieve the Google Sheet  to see the positions before updating the prices and making rebalancing decisions. IMPORTANT: you MUST also use this tool after rebalancing decisions to check that  the new equity / fixed income breakdown achieves your goal. If not, keep iterating.

Here is the portfolio sheet that I use – please save a copy of this in your Google Drive for your agent!

Resources for Week 2

Week 2 Day 2:

  • PLEASE NOTE: A couple of students have mentioned to me that the free ElevenLabs plan may not support the TTS and STT API that we use at the start. If you’re on the free plan, please simply skip this first approach. The 2nd approach we use (with ElevenLabs calling n8n) is a far better approach, that is far more common in practice, and it should work fine with the free plan.
  • PLEASE NOTE 2! There seems to be an issue with ElevenLabs (perhaps temporary) – Agents in ElevenLabs don’t seem to be making use of Tools unless the Agent is published. If you’re having problems getting your Agent to call the n8n webhook, then please try publishing the Agent in ElevenLabs. See the Q&A comments on this.
  • Here is the voice.html page for submitting audio.

Week 2 Day 4: The Products sheet for the RAG information.

The SQL code to create the database table – the only code on the course! Notice the 1536 in 2 places here for the number of dimensions; you’ll need to change this if you’re using a different encoder.

create table if not exists knowledgebase (
id uuid primary key default gen_random_uuid(),
content text,
metadata jsonb,
embedding vector(1536)
);
create or replace function public.match_documents (
query_embedding vector(1536),
match_count int default 5,
filter jsonb default '{}'
)
returns table (
id uuid,
content text,
metadata jsonb,
similarity float
)
language sql stable
as $$
select
id,
content,
metadata,
1 - (embedding <=> query_embedding) as similarity
from knowledgebase
where metadata @> filter
order by embedding <=> query_embedding
limit match_count;
$$;
Resources for Week 3

Week 3 Day 1:

Link to Ollama: https://ollama.com

The docker command to run n8n self-hosted locally. (If you want schedulers inside n8n to have the right timezone, then replace Europe/London with your timezone from this document.). Please note that to stop n8n when it’s running, simply press Ctrl+C in the Terminal / Powershell where it’s running.

docker run -it --rm --name n8n -p 5678:5678 -e GENERIC_TIMEZONE="Europe/London" -e TZ="Europe/London" -e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true -e N8N_RUNNERS_ENABLED=true -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n

And later, the same docker command but with the ability to connect to the host so that Ollama can run locally:

docker run -it --rm --name n8n -p 5678:5678 --add-host=host.docker.internal:host-gateway -e GENERIC_TIMEZONE="Europe/London" -e TZ="Europe/London" -e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true -e N8N_RUNNERS_ENABLED=true -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n

Week 3, Day 2:
Here is a note from student Nguyen if you use self-hosted n8n, confirmed by another student (rephrased):

I used n8n locally and followed the instructions for the HTTP node – Post, send Body, JSON, {{$json.data}} – but webhook.site returned blank in request content. I found a solution to use Raw in the body content type, application/json in the Content type, {{ JSON.stringify($json.data) }} in the body field.

The Google Drive OAuth process has been greatly simplified for n8n cloud – you can use the same approach as we did for Google Sheets; just click to sign in with your credentials. If you’re using self-hosted n8n, you’ll need to follow the same steps as I do on the video.

With thank you to student Omer C.: if you get this error during Google Drive OAuth2 API process:

n8n.cloud has not completed the Google verification process. The app is currently being tested, and can only be accessed by developer-approved testers. If you think you should have access, contact the developer.

Then add your email address:

  1. Go to https://console.cloud.google.com/auth/audience
  2. Find “Test Users”
  3. Click “+ Add user”

Week 3, Day 2/3 – FIRECRAWL

With thanks to Steve X: The Firecrawl node has been updated – the similar action I used is now under ‘MAP & SEARCH ACTIONS’ / ‘Search the web and scrape results’ instead of ‘Search and optionally scrape search’

If Project Variables aren’t supported by your version of n8n, simply use the Firecrawl token directly in the URL. No need to upgrade to the paid version.

Week 3, Day 4:
The post on Context Engineering by Phil Schmid
And the seminal The Lethal Trifecta by the always brilliant Simon Willison.

Week 3, Days 4 and 5:
I’ve put a full export of all the Capstone Project workflows in the week 3 folder here. I recommend you create this Project from scratch, but if you’d prefer to use mine, you can import from these files.

You’ll need to create each Workflow, then click in the three-dots menu on the top right, and select “Import from File”. You’ll need to update the credentials, the Pushover User token, and your name & Voice Agent phone number.

Keep in mind: the Capstone project is a great end-to-end example and could form the basis of a real-world commercial product. Before taking it further, though, you’d need to make the Pipedrive query more scalable by only working with a subset of people at a time.

Thank you for making it to the very end! Please connect with me on LinkedIn, and/or sign up to stay in touch below. I can’t wait to hear what you make of the course.

One response to “AI Builder with n8n – Create Agents and Voice Agents”

  1. its awesome

Leave a Reply

Discover more from Edward Donner

Subscribe now to keep reading and get access to the full archive.

Continue reading