DelegIA
Get started

How to build an AI agent for your business

To build an AI agent for your business, start with a specific task. Then gather the data and permissions it needs, choose a tool, test it with real cases, and assign someone to review its work.

16 min read
n8n and Claude logos on two emblems against a purple background

In this November 2026 tutorial, you'll learn how to create your own AI agent and build a workflow from scratch without coding, using n8n and Claude. The agent reads quote requests that arrive by email, checks your price list, and drafts a reply for someone to approve before it's sent. You don't need to know how to code to follow along.

What is an AI agent and how do you build one?

In a standard automation, every step is set in advance. An agent lets the model choose some of those steps, within the rules you write and using the tools you give it access to.

For the full definition, see the glossary. Our article on agents, chatbots, and assistants explains the differences between them.

How to build a simple AI agent: choose the task first

When people ask “How can I create my own AI agent for a custom workflow?”, they often start looking at tools. Without a task in mind, though, it's easy to end up with a demo nobody uses. To work out how to build your own AI agent from scratch, first decide what it should do. That determines the data, permissions, and tools you'll need.

A good first task has four characteristics:

  • It happens many times a week.
  • It starts with something coming in: an email, a form or an order.
  • If something goes wrong, there's time to fix it before it reaches the customer.
  • Part of it can't be handled with a fixed rule.

If you can write the whole thing as “if this happens, do that,” a regular automation will do the job more cheaply and predictably.

Quote requests need some interpretation because customers describe what they want in different ways. One asks for “40 boxes of item T-220.” Another wants “the same as last month, but twice as many,” or leaves out the quantity altogether. The model interprets the request, identifies the product in the price list, and checks for missing information. Fixed steps handle the exact price lookup, calculations, and sending the email.

Before opening a tool, write down what comes in, what the agent should do with it, and who receives the result. If you can't fill in those details, define the task before you start building.

The task in one sentence

When X arrives, the agent does Y and hands it to Z.

How do you create an AI agent with the right data and permissions?

An agent needs the information that arrives with each request, such as a customer's email, order, or form. It also needs reference information, such as price lists, sales terms, and lead times, to decide what to do. That information usually already exists in spreadsheets, PDFs, or someone's head. Organize it before you build: if there are three versions of the price list, the agent will use whichever it finds, just as a new employee might.

Give the agent its own account with only the permissions it needs. You'll be able to trace its actions and revoke its access without affecting an employee's account. Keep a person in charge of approving anything it sends until testing shows you can change that setup.

If the agent will read customer data, use a model under business terms. This tutorial uses Anthropic's API. According to Anthropic's Privacy Center, inputs and outputs from its commercial products, including the API, are not used to train its models by default. For a U.S. business, the FTC also recommends keeping only the personal information you need and limiting access to people who need it for their work. [Sources 10 and 14]

How to train an AI agent

Training an AI agent usually means teaching it how your business works. Claude is already trained, so this guide adapts it using instructions, examples, and reference data you can update yourself:

  • Instructions: the task, tone, what it can decide on its own and what always goes to a person.
  • Examples: two or three cases handled the way your best salesperson would handle them.
  • Reference data: the price list and terms, which the agent reads when it needs them.

Fine-tuning, which retrains a model with your data, is a separate project. You don't need it for this task or to train a chatbot on your company's information.

How do I build a custom AI agent for my workflow without coding?

Before choosing an AI tool, look at where the task happens and how much control you need over each step.

ApproachA good fit whenExamplesWho you'll need
Agents within your existing suiteThe task stays in the apps your team already uses, and the vendor's approach fits how you workChatGPT workspace agents, Claude Projects, Copilot Studio, Gemini GemsSomeone on the team with good judgment; very little technical knowledge
Automation platformThe task crosses several applications and you want to control what the model decides, what fixed rules handle, and where a person approves the resultn8n, MakeSomeone comfortable working with software; access to technical help is useful
Custom codeThe agent runs inside your own softwareClaude Agent SDK, OpenAI Agents SDK, LangGraphA developer
VoiceThe agent answers or makes callsElevenLabs Agents with a Twilio numberSomeone with telephony expertise

If your company uses ChatGPT Business or Enterprise, look at workspace agents first. Describe the work in the agent builder, connect the agent to apps, and run it on a schedule, from Slack, or through another system. You can try it within software you're already paying for. For Claude, Copilot, and Gemini, see each tool's guide.

If you want to build an AI agent without code and connect several applications, n8n is an option. Its no-code AI agent builder lets you see what the model decides, what fixed steps handle, and where a person reviews the result. You can install Community Edition on a company server for internal business use without a software license fee under its Sustainable Use License. n8n also offers a hosted service. The tutorial below walks through the setup with Claude.

AI agents with Python and open-source tools

If someone on your team codes and wants to build from scratch, development tools give you more control. Anthropic's Claude Agent SDK supports Python and TypeScript and provides the loop an agent uses to make decisions, use tools, and review its work. You can also find open-source agent tools on GitHub, including LangGraph, a library for multistep agents in Python. Writing code makes sense when the agent needs to run inside your own software. For connecting programs you already use, n8n is usually faster to set up.

If you want a chatbot

For a chatbot on your website, you'll also need to define the task, gather the data, write instructions, and run tests. Our AI chatbots page explains how we build a custom chatbot for a business. For WhatsApp, see the WhatsApp chatbot guide.

Tutorial: how to build an AI agent with n8n and Claude

An email arrives at quotes@: “Hi, could you send me a quote for 40 boxes of item T-220, delivered to Dallas?” The agent checks that it has the product, quantity, and delivery location, then looks up the price and drafts a reply. The person responsible for quotes receives the draft by email and approves or rejects it before it's sent. If information is missing, the agent drafts a follow-up email, which also needs approval. Requests it can't handle go to the salesperson.

The request follows these steps:

  1. Email receivedGmail, Quotes label
  2. Agent with ClaudePriceList and Calculator
  3. Approvalthe person responsible for quotes
  4. Reply to the customerin the same thread
Unusual request. The agent doesn't draft a customer reply. It sends the salesperson a note with the original email.

In n8n, you connect applications using linked boxes called nodes. Claude, Anthropic's AI model, makes the agent's decisions.

Before you start, you'll need:

  • An n8n account, hosted or installed on a company server.
  • The request inbox, in Gmail or Google Workspace.
  • An Anthropic API key, created in its console. It's how n8n connects to Claude, with usage-based billing.
  • Your price list in Google Sheets, with one row per product.

Step 1. Prepare the price list and terms

Put your price list in a sheet with one row per product and these columns: item number, description, unit, price and lead time. If the list is long, start with the products requested most often.

In a separate note, write down the terms you always include in a quote: payment terms, shipping, and how long the quote is valid. Keep the note to half a page; you'll paste it into the instructions in step 4. For the U.S. example, use USD and specify how your business handles applicable sales tax. The model must not invent a tax rate.

Step 2. Get email into the workflow

Create a workflow in n8n with Gmail Trigger as its first node. This starts the workflow when a message arrives. Connect it to the inbox, choose how often it checks for messages, and filter by a label such as Quotes. In Gmail, set up a filter that applies that label to messages sent to quotes@ so the agent sees only those messages.

Turn off Simplify. If it's on, the trigger returns the sender, subject, IDs, and only a snippet from the beginning of the email, so the agent won't read the full request.

This agent only reads the email text. If a customer sends the request in an attached PDF, it won't open it or know it's there unless the text mentions it. That's why step 4 tells it to send any email mentioning an attachment to the salesperson.

Gmail Trigger in n8n with Simplify turned off, the label:quotes filter and output containing the full sample email.
Gmail Trigger with Simplify turned off and the label filter. On the right is its output: the full email text.

Step 3. Add the agent and connect Claude

Add an AI Agent node after the trigger. In its model slot, add the Anthropic node, create a credential using your API key and choose a Claude model.

Under Source for Prompt (User Message), choose Define below. In Prompt (User Message), drag in the sender, subject, and email text from the trigger's output. For example:

Prompt
Request received.
From: [sender]
Subject: [subject]
Body: [email text]

Without this step, the agent starts with no input. It's the step people most often miss.

Step 4. Write the instructions

Under Options, click Add Option and choose System Message. This is where you explain the job. Write it as you would for a new employee, including the terms from step 1:

System Message
You draft replies to quote requests for [company].

1. Check that the request includes the product, quantity and delivery location.
   If anything is missing, draft a short email asking for it. Do not look up prices.
2. Look up each product using PriceList. Use only prices from that list.
3. Do the math with Calculator, never from memory.
4. Draft a reply with each line price, the subtotal before sales tax, the lead time
   and these terms: [paste payment terms, shipping and quote validity here].
   Follow the company's supplied tax instructions. Do not invent tax rates or amounts.
5. If the customer asks for a discount, rush delivery, a product outside the list
   or mentions an attachment, do not draft a reply. Write a note for the salesperson.

A person reviews everything you draft before it is sent.
Tone: friendly, professional and direct. No filler.

Above all, use point 5 to spell out which decisions the agent must leave to a person.

Step 5. Give it the price list and a calculator

Add two tools to the agent's tools slot:

  • Add Google Sheets, select the operation that retrieves rows, and connect it to your price list. Name it PriceList, set Tool Description to Set Manually, and enter “Look up prices and lead times by item number” in Description. The agent reads this description to decide when to use the tool.
  • Add n8n's calculator and name it Calculator so the model uses it for the math.

The agent has no email tool. It drafts the reply; the workflow sends it in step 7, after approval.

AI Agent in n8n connected to Anthropic Chat Model, PriceList, Calculator, and Structured Output Parser.
The agent with Claude as its model and, below it, PriceList, Calculator, and the output format from step 6.

Step 6. Give the output a consistent structure

Turn on the agent's option to require a specific output format and connect a Structured Output Parser. Give it this example so n8n can generate the format:

JSON
{
  "type": "reply",
  "text": "Email text for the customer",
  "sales_note": ""
}

The agent returns reply, request_info, or escalate in the type field. The workflow uses that value to choose the next step without having to interpret the draft. These fields are inside output, so use output.type for the type and output.text for the email text in the nodes that follow.

Step 7. Approval and sending

Add a Switch node after the agent, checking output.type:

  • reply and request_info go to a Gmail node using Send and Wait for Response, with Response Type set to Approval. Send the customer's email and proposed reply to the person responsible for quotes. Under Approval Options, choose Approve and Disapprove to show two buttons. The workflow waits until the reviewer clicks one.
  • An If node checks {{ $json.data.approved }} using is true. Approval sends the workflow to the final Gmail node, which uses Reply to respond in the same thread. In Message ID, use the trigger's id field; messageId is a different field. In Message, use the agent's draft from its node: {{ $('AI Agent').item.json.output.text }}. If the reviewer rejects it, nothing is sent and the salesperson replies manually.
  • escalate goes to a Gmail node that sends the salesperson the note with the original email.
Complete n8n workflow: triggers, agent, evaluation check, Switch, approval, If, customer reply, and salesperson notification.
The complete workflow. The top branch stores the tests from step 8; the bottom branch goes through Switch, approval and If before replying.
n8n approval email with the customer's request, the agent's proposed quote, and Reject and Approve buttons.
The person responsible for quotes receives the customer's request and the agent's draft reply by email, with two buttons. The reply is sent only when they click Approve.

Step 8. Test it before turning it on

Collect twenty to thirty requests in a spreadsheet. Use examples from recent months and write others for situations you haven't seen yet, such as a missing quantity, a discontinued product, or an attachment mentioned in the text. Add a column for the email and one for the expected action (reply, request information, or escalate). Leave blank columns for the results.

n8n evaluations run these cases one by one:

  • Add a second trigger, Evaluation Trigger, which reads the sheet row by row.
  • After each trigger, add an Edit Fields node that puts the text in a field with the same name. Use that field in the prompt from step 3 so the agent receives the same structure from either source.
  • After the agent, an Evaluation node using Check If Evaluating separates tests from live work. Connect the Switch from step 7 to its Normal output. On the test branch, another Evaluation node using Set Outputs writes the agent's type and text back to the sheet. That branch never reaches Gmail, so no customer receives a test email.

Start the evaluation from Evaluation Trigger. The workflow runs through every row and records the agent's output in the sheet. Compare each result with the expected action. If a case fails, check whether the cause is a connection problem or an error in the response. An expired credential, a moved sheet, or an empty field is a connection problem; check n8n's execution list. A misread price or a request that should have gone to the salesperson calls for a correction to the instructions, examples, or price list. Repeat the tests until every row behaves as expected.

Step 9. Turn it on

Activate the workflow. From then on, the salesperson reviews each request before anything is sent. n8n's execution list shows which email arrived, which price list rows the agent consulted, what it drafted, and what was approved.

How to tell when the agent can send without approval

Set the criteria before turning the agent on. For this one, prices must match the price list, quantities must be read correctly, terms must be correct, and all unusual requests must go to the salesperson. If a particular type of reply meets every criterion over a period of time, you can let the agent send that type without approval. That might cover catalog products in normal quantities, while discounts, new customers, or large amounts still need review.

Even if drafts are approved without edits, check a sample against the price list from time to time. A busy salesperson may approve a wrong price, so approval alone doesn't tell you whether the agent is ready to send on its own.

What maintenance an AI agent needs

Keep the agent's reference information up to date. When you change the price list, make sure it reads the new one, and add new products to the sheet when you launch them. If Google or Anthropic changes a connection, someone needs to check that the workflow still runs.

Assign someone to receive error alerts, check a sample of the agent's work, and update its instructions when your process changes. You or someone on your team needs to own that responsibility.

How much does it cost to build an AI agent and keep it running? Model costs depend on which model you use, the length of each email, and how many times the agent looks up the price list per request. Check actual usage in Anthropic's console during the first month to see what you're spending.

How to create your own AI agent for free

If you want to build an AI agent for free, start by testing the idea. You can install n8n Community Edition as a free AI agent builder on your own computer or server, then use Claude's or ChatGPT's free plan to try the instructions on a few cases.

A free test helps you work out whether the task can be automated. To run this workflow every day, though, you'll connect n8n to Claude through the paid, usage-based API. You'll also need to keep the server running and up to date, with someone monitoring it. Budget for model usage, hosting, and maintenance time.

How to build an AI voice agent

To create a voice-enabled AI agent, define the task, gather the data, write instructions, choose tools, and test how it handles requests.

Respond quickly

Keep responses quick, since callers notice pauses.

A connected number

Connect a phone number, such as one from Twilio.

The voice matters

Choose the voice carefully. How it sounds matters as much as what it says.

With ElevenLabs Agents, an AI voice agent builder, you write the instructions, choose a voice, and connect tools such as a calendar for booking appointments. Then import a Twilio number into its dashboard and assign the agent to answer calls. As with email, decide in advance which requests need a person.

Our voice agents page explains how we build an agent to answer your business calls.

Common mistakes when building an AI agent

  • Letting the model do the math or send emails on its own. Predictable actions, such as calculations and sending email, belong in fixed steps.
  • Testing only the easy cases. Include requests that cover situations you haven't encountered yet.
  • Testing with the live inbox connected. A test can reach a customer if the test branch leads to Gmail.
  • Treating a connection problem as a mistake in the agent's response. Changing instructions won't fix an expired credential.

When it makes sense to hire someone to build it

You can build a custom AI agent yourself when the task is simple, the agent only prepares drafts, and someone has time to maintain it. Consider hiring someone if it needs to write to your ERP or CRM, handle customer data or many exceptions, or if a mistake could cause problems with a customer or the tax authorities.

At DelegIA, we help you choose the task, build the agent, and connect it to your business software with only the permissions it needs. We test it on your cases and prepare your team to review its work. Your business owns the workflow, accounts, and instructions. For this quote workflow, the model receives only the email and the price list rows needed for each request.

If you have a task in mind, we can discuss it on a free initial call to see where work gets stuck and which agent would help.

Sources

  1. n8n: Gmail Trigger docs.n8n.io
  2. n8n: Tools Agent, Prompt y System Message docs.n8n.io
  3. n8n: Structured Output Parser docs.n8n.io
  4. n8n: Calculator docs.n8n.io
  5. n8n: Gmail message operations docs.n8n.io
  6. n8n: Run quick evaluations docs.n8n.io
  7. n8n: Evaluation docs.n8n.io
  8. n8n: Sustainable Use License docs.n8n.io
  9. Anthropic: Claude Agent SDK code.claude.com
  10. Anthropic: Is my data used for model training? privacy.claude.com
  11. OpenAI: ChatGPT workspace agents help.openai.com
  12. ElevenLabs: Twilio native integration elevenlabs.io
  13. LangGraph overview docs.langchain.com
  14. FTC: Protecting Personal Information, A Guide for Business www.ftc.gov
  15. Texas.gov: Texas Taxes www.texas.gov
  16. n8n: precios oficiales n8n.io
  17. Claude: precios oficiales claude.com
  18. ChatGPT: precios oficiales openai.com
  19. n8n: How to build your first AI agent blog.n8n.io
Albert López

Written by

Albert López

Founder of DelegIA. He helps small and midsize businesses in Spain decide where to use AI, implements the systems they agree on, and supports the teams using them.

LinkedInReviewed on November 22, 2026

Tell us which task you'd like an agent to handle in your business

We'll call you for a free conversation about where work gets stuck.

Albert López, founder of DelegIA
albert@delegia.es

Albert López

Founder of DelegIA