Skip to content

How to create an AI agent in six steps

November 13, 2026 · 6 min read

Most of the work in creating an AI agent is not the model; it is deciding what the agent may do, what starts it, and where a person has the final say. Get those right and the agent is a short job description that something can build and run for you, with a model asked only where the job needs judgment.

The six steps

1. Write the job as one sentence

Start with a sentence that names four things: what starts the agent, what it reads, what it does, and when it stops. "Every morning at eight, read yesterday's support emails, sort them by urgency, and post a short list to the team channel" is a complete job. "Help with support" is not.

The stopping point matters most. An agent that does not know when it is done keeps calling tools, and every extra turn costs money and risks a wrong move. Write the end state down: "stop after the list is posted" or "stop once it has an answer, or after eight attempts".

2. Separate the steps you already know from the judgment calls

Mark each part of your sentence as known or judged. "Read yesterday's emails" is known: there is one right way to do it. "Sort by urgency" is a judgment. "Post the list" is known.

The taxonomy in the sources below draws the same line: workflows follow predefined paths, agents let the model direct its own process, and the simplest thing that works should win. For most business jobs the result is a workflow with one or two judgment calls inside it. Those are the only places a model belongs; everything else should run the same way every time and spend nothing on AI doing it.

3. Pick the trigger

A trigger is what starts a run. There are four kinds:

  • A schedule. Every hour, every weekday at nine, the first of the month. A scheduled run starts whether or not there is anything new.

  • An event. Something happens in an app you use: a new email, a new row, a payment. The run starts when a matching event is delivered.

  • A message. Someone writes to the agent in Slack or Telegram, and each message starts a run.

  • A webhook. Another system sends a notification to an address the agent listens on, and anything that arrives there starts a run.

Choose the one that matches how the work arrives: a daily digest is a schedule, an assistant is a message, a "something changed, act on it" job is an event or a webhook.

4. Give it tools and limits

Tools are the accounts and apps the agent may use. List them, and for each say whether the agent may only read or may also write. Reading an inbox is low risk; sending from it is not, and the two should be decided separately.

Then decide where a person steps in. A good default: read freely, write only in low-stakes places (a draft, an internal channel), and hand everything else to a person. On Whenever a model picks only from the tools a step offers and cannot reach any other, so the limits you set here are the limits the agent actually has.

5. Test the messy cases

The clean case will work. Test the ones that will not:

  • Ambiguous input. A message that could mean two things. The agent should ask, or route it to a person, not guess.

  • Duplicate delivery. The same email or event arriving twice. Check the downstream record, not the agent's reply: did it create two tickets?

  • Empty result. A scheduled run that finds nothing new. It should finish quietly, not summarise nothing.

Test against real inputs where you can, be careful with tests that write to live systems, and read each run's log step by step.

6. Run it where you do not have to keep a laptop on

An agent in a chat window or on your own machine runs only while you are there. A scheduled or message-triggered job needs somewhere that stays on, logs each run, and tells you when one fails.

Whenever gives you two doors to the same place. In the builder, you describe the agent's job in plain words, review a map of its steps that shows which ones ask a model, connect the accounts, test, and publish on a schedule, a webhook or a message trigger. Or, if you already have the task written with a coding agent such as Claude Code, Cursor or Codex, point it at the Whenever skill from the /deploy page: it saves the job as a draft workflow, and you review it, connect the accounts, test, and decide when it goes live. Either way, every run is logged and you get an email when an automated run fails.

A worked example

Picture a personal assistant that lives in Telegram. This is a design example of the six steps together, not a preconfigured template.

The sentence. "When I message the bot, answer my question using my open tasks and my inbox, and stop once it has an answer or after eight attempts."

Known versus judged. Reading open tasks and searching the inbox are known steps. Deciding which to consult, and in what order, is the judgment, so that is the one place the model sits.

The trigger. A message. Each Telegram message starts one run.

Tools and limits. Two read-only tools: list open tasks, and search email. No sending, deleting or editing, and the model can call nothing else. Because the agent can read a private inbox, it answers only its owner's private chat and ignores every other chat and every message from another bot. Data that comes back from a tool is treated as information, never as an instruction.

The messy cases. A message that is not text is ignored with a note saying why. A question the model cannot answer in eight turns gets a plain "I ran out of steps" instead of a guess. If Telegram does not confirm the reply, the run fails loudly rather than pretending it worked.

Where it runs. On Whenever, with the model loop, its turn cap and its chat check inside one reviewable workflow. The Whenever docs carry this assistant as a complete example.

What it costs

Whenever meters runs: one run is one execution of the workflow, start to finish. Building and editing with AI is free within weekly usage limits. The Hobby plan is $0 a month with no credit card, and includes 100 runs a month, one active workflow and $1 of included AI spend in runs. The Pro plan includes 10,000 runs a month, unlimited active workflows and $10 of included AI spend in runs; its price is on the pricing page.

AI spend in runs is what the agent spends on a model while it works, and only the steps that ask a model spend it. The Telegram assistant spends it on every message. A morning digest that asks a model to rank a list spends it once per run, and a job with no judgment call spends none. That is the payoff of step two: the fewer places the model sits, the smaller and more predictable the bill.

A few useful answers

Can I create an AI agent without coding?

Yes. On Whenever you describe the agent's job in plain words, review the map of its steps, test it against real inputs, and publish it. What Whenever writes behind that map is a readable file you can hand to a developer, but you never have to write or read it.

Do I need an API key?

Not to build on Whenever. You connect the accounts the agent uses, such as Gmail, Slack or Telegram, once in Setup, and the model comes from your plan's AI allowance. A coding agent that deploys through the Whenever skill never sees those credentials either.

How is this different from a chatbot?

A chatbot answers in a conversation and stops there. An agent acts in your apps: it reads a task list, searches an inbox, files a ticket or posts a summary, and a schedule or an event can start it rather than only a person typing. The Telegram assistant is both: it talks like a chatbot and acts through tools like an agent.

How long does it take?

Steps one to four are a conversation you can have in an afternoon, and they are the part worth slowing down for. In Whenever's builder the agent is generated from the description, so the time after that goes into connecting accounts and testing the messy cases.

Does it call a model on every run?

Only in the steps that need one. A chat agent calls a model on each message. A report agent may call one once to summarise and do everything else without it. A job with no judgment call runs with no model at all, and spends nothing on AI.

Sources & further reading

Sources reviewed November 13, 2026.

  • Anthropic: Building effective agents — workflows versus agents, and why to start simple.

  • Whenever docs: An AI assistant workflow — the Telegram assistant in full.

  • Whenever docs: Workflow triggers

  • Whenever docs: Workflow steps and context

  • Whenever pricing

Choose your next step

  • Build an AI agent by describing it

  • Deploy an agent's job from your coding agent

  • Browse AI agent templates

  • Agentic workflows: an AI agent, a workflow, or both?

Your first workflow is one sentence away.

No credit card required. One workflow is free. AI for building has weekly usage limits.