Autonomous Agent

Learn how to use the Autonomous Agent node in YourGPT Studio to build a goal-driven AI agent that reasons, calls your APIs and code, and routes the conversation on its own.

The Autonomous Agent is an AI node that you give a goal to — then it figures out the rest at runtime. Instead of wiring every step by hand, you describe what the agent should do and give it a set of skills (APIs to call, code to run, knowledge to search). The agent reads the conversation, decides which skills to use and when, replies to the user, and can route the flow to a different node when a condition you defined is met.

Autonomous Agent node

Autonomous Agent vs. other AI nodes

A regular AI Response or AI Retrieval node runs one deterministic step and moves on. The Autonomous Agent is agentic — it runs a reasoning loop, can call multiple tools across several turns, and decides for itself when it's done or when to hand the conversation off.

AI Response / RetrievalAutonomous Agent
BehaviorOne fixed stepMulti-step reasoning loop
ToolsNoneAPI skills, code skills, knowledge, web search
RoutingAlways the next nodeCan exit to different nodes based on conditions
Best forSingle, predictable repliesOpen-ended tasks (support, lookups, multi-step help)

Add the node to your flow

  1. Drop the node onto the canvas:
    • In the Flow section of Chatbot Studio, open the AI group in the tools panel and drag Autonomous Agent onto the canvas. Connect it like any other node — an input handle on the left, an output handle on the right.
  2. Write the instructions:
    • Click the node to open its panel and tell the agent what its job is. This is the only required field.
  3. Add skills:
    • Use + Add Skill (or the Agent Skills panel that appears when the node is selected) to give the agent API endpoints, code functions, exit scenarios, and rich-message permissions.

Tip

The agent calls skills automatically during the conversation — you don't connect them as separate steps. Skills live inside the agent node; only Exit Scenarios create outgoing connections to other nodes.

Settings

The Settings tab controls the agent's core behavior.

Autonomous Agent instructions and first message

Instructions (required)

Describe the agent's job in plain language — for example, "Help the user with their support question. Look up their order status if needed." This is the agent's primary directive.

You can use flow variables here:

  • Read a variable with {{FLOW.variableName}}.
  • Store into a variable by mentioning its plain name (e.g. order_id) — the agent sets it when the value comes up in the conversation.

First message (optional)

Controls the agent's opening message. Switch between two modes:

  • AI (default): the agent writes its own opener, guided by any text you provide (e.g. "greet and list what you can help with").
  • Manual: you write the exact opening message (e.g. "Hi! 👋 How can I help?").

Tools

Built-in capabilities the agent can use. The agent decides when to use them.

Autonomous Agent tools and settings

ToolDefaultWhat it does
Search KnowledgeOnSearch your knowledge base to answer questions
Web SearchOffSearch the internet for current information
Transfer to HumanOnEscalate the conversation to a human agent

Settings

SettingDefaultRangeWhat it does
Save as flow variablesOnVariables the agent sets appear in the flow's Variables panel for use in later nodes
Previous Chat Count50–50How many earlier messages the agent sees for context (use 0 for none)
Max Iterations101–50Maximum tool-call loops per turn — prevents runaway loops

Model is automatic

The model, temperature, and token limits for the Autonomous Agent are managed automatically — there's nothing to configure. If the primary model is unavailable, the system falls back to a backup model so the agent keeps working.

Skills

Skills are the tools you give the agent. They're configured inside the node and called automatically based on the conversation. There are four skill types.

Add a skill

SkillMultiple allowed?Purpose
API SkillYesCall REST endpoints to fetch or update external data
Code SkillYesRun custom JavaScript logic
Exit ScenariosOne per agentDefine conditions that exit the agent and route to another node
Rich MessagesOne per agentControl which media types the agent may send

Note

Every function across all skills shares one tool namespace, so tool names must be unique within the agent. The builder warns you about duplicates. Use clear snake_case names like search_products or get_order_status.

API Skills

Declare REST endpoints the agent can call. Add a Skill label (e.g. "Product APIs") to group them, then add one or more endpoints.

For each endpoint:

  • Tool name — the unique identifier the agent uses (no spaces).
  • Description — explains what it does and when to call it. The agent reads this to decide whether to use the endpoint, so be specific (e.g. "Search products by keyword. Use when the user asks about products.").
  • Endpoint — the HTTP method (GET, POST, PUT, DELETE, PATCH) and the URL.
  • Headers — static values like API keys or auth tokens. These are set at build time, not from the conversation.
  • Parameters — slots the agent fills from the conversation at runtime. Give each a name and a description (e.g. a query parameter described as "search keyword").

You can also use Import cURL to paste a curl command — the URL, method, and headers are imported as-is, and the body/query fields become parameters the agent fills.

Use the Test API button to run the endpoint with sample parameter values and inspect the response before going live.

API Skill configuration

Code Skills

Write JavaScript functions the agent can run — useful for calculations, formatting, or conditional logic. Add a Skill label (e.g. "Calculation Tools"), then add one or more functions.

For each function:

  • Function name — the unique identifier the agent uses (no spaces).
  • Description — what it does and when to call it.
  • Parameters — inputs the agent provides, available in your code as params.name.
  • JavaScript code — your logic. Whatever you return is sent back to the agent as the tool result.
// params object is injected automatically by the agent
// Example: if you declared a param "n", access it as params.n
// Return a value — the agent sees it as the tool result

return params.n * 2;

Code Skill editor

Exit Scenarios

Exit Scenarios let the agent stop and route the conversation to a different node when a condition is met. There's one Exit Scenarios skill per agent, and it can hold several scenarios.

For each scenario:

  • Condition — a plain-language description of when the agent should exit (e.g. "User wants a refund" or "User explicitly asks to speak to a human"). The agent evaluates this on every turn.
  • Exit reply (optional) — a message the agent sends just before it exits (e.g. "Let me connect you with the right team…").
  • Routing handle — each scenario gets its own output handle on the node. Wire it to wherever that path should go, such as a human-handoff or refund flow.

Exit Scenarios

Tip

Write conditions that are unambiguous. "User explicitly requested a human agent" routes more reliably than a vague "agent is unsure".

Rich Messages

Control which media types the agent is allowed to send mid-conversation. There's one Rich Messages skill per agent, and all types are on by default.

TypeWhat it allows
ImageSend images
VideoSend video files
AudioSend audio files
CardSend a single info/product card
CarouselSend a multi-card carousel

Channel support

Available rich-message types depend on the channel the conversation is on. If a channel can't deliver a format, the agent simply won't offer it — for example, voice (Twilio Call) supports audio only, WhatsApp doesn't support carousels (cards become interactive lists), and SMS is text-only. Web widget and most messaging channels support all types.

How the agent runs

When the flow reaches the node, the agent:

  1. Reads your instructions and the last Previous Chat Count messages for context.
  2. Decides whether it can answer directly or needs a tool. If it needs one, it fills in the parameters from the conversation and calls the matching API or code skill.
  3. Reviews the result and loops again — up to Max Iterations times — calling more tools or replying to the user.
  4. Checks your exit conditions each turn. If one matches, it sends the optional exit reply and routes the flow to that scenario's connected node.
  5. Otherwise, when it's done it continues to the node connected to the agent's normal output.

Any variables the agent collects are saved to the flow (when Save as flow variables is on) and can be used downstream with {{FLOW.variableName}}.

Use cases

  • Customer support — answer questions from your knowledge base, look up orders via an API, and hand off to a human on a refund request.
  • Lead qualification — ask questions, store answers as flow variables, and branch based on the outcome.
  • Multi-step lookups — chain several API calls (e.g. find a customer, then fetch their subscription) without wiring each step by hand.
  • Calculations & formatting — run code skills to compute totals, validate input, or transform data mid-conversation.

Best practices

Be specific in instructions

Tell the agent its role, the tasks to handle, and what tools it has — e.g. "You are a support agent. Look up orders by ID and check delivery status. Escalate refund requests to a human."

Write tool descriptions for the agent, not for you

The agent chooses tools based on their descriptions. State clearly when each one should be used so it calls the right tool at the right time.

Keep Max Iterations reasonable

Most tasks finish in a handful of tool calls. A high limit allows more complex chains but can increase response time and cost.

On this page