> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.meetgail.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.meetgail.com/_mcp/server.

# Agent

> Hands a prompt and some data to an AI agent and returns the structured fields you define.

The Agent node gives an AI agent a set of instructions and some data to work
with, and gets back a tidy set of fields you defined in advance. Instead of a
free-form paragraph, you decide exactly what should come out, such as a lead
quality, a reason, and a suggested next step, and the rest of the workflow reads
those fields directly.

## When to use it

* You want to classify or score incoming data, like rating a lead hot, warm, or
  cold from a web form submission.
* You need to pull structured details out of messy text, such as turning an
  email or support ticket into named fields.
* You want to generate tailored content, like a personalized follow-up message
  built from a customer's details.
* You need a judgment call that would be hard to write as fixed rules.

## Inputs

| Field                 | What it's for                                                                                          | Example                                                                                                |
| --------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| Prompt                | The instructions telling the agent what to do.                                                         | "Classify this insurance lead and recommend a next step."                                              |
| Agent Input           | The data for the agent to work on, usually pulled from an earlier step.                                | The response body from an [HTTP Request](/platform/workflows/node-reference/web-and-http/http-request) |
| Desired Output Fields | The fields you want back, each with a name and a short description so the agent knows what to fill in. | `quality`, `reason`, `suggestedAction`                                                                 |
| Files                 | Optional files to include, such as a document produced by an earlier step, for the agent to read.      | A PDF from a download step                                                                             |

## Outputs

| Field  | What you get back                                                                                |
| ------ | ------------------------------------------------------------------------------------------------ |
| Output | The fields you defined, filled in by the agent. Each field becomes a value later steps can read. |

## Example

A web lead comes in for Sarah Chen. An earlier step has already pulled her
account details, and an Agent node is told to classify the lead and recommend a
next step. Its output fields are `quality`, `reason`, and `suggestedAction`. The
agent returns `quality: warm`, a short reason, and a suggested action, and a
[Conditional](/platform/workflows/node-reference/logic-and-flow/conditional) step then
routes hot leads straight to a salesperson and nurtures the rest.

![The Agent node configuration panel, showing the prompt, agent input, and desired output fields.](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/gail.docs.buildwithfern.com/51f39e4666cf9526b185eda1417aab3ed9e403a68470cd568265a329f95265e3/docs/pages/platform/workflows/assets/ai-agent.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260823%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260823T232845Z&X-Amz-Expires=604800&X-Amz-Signature=d20d0f0493bd6d6e2bce424859ac80d63f259d95dd3db1e397e0df124943e369&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

The output fields are where the quality comes from. Give each one a clear name
and a short description of what it should contain, and keep the list focused on
what later steps actually need. Vague or overlapping fields lead to vague
answers.

## Related nodes

#### [Document Analysis](/platform/workflows/node-reference/ai/document-analysis)

Check and read details off uploaded documents instead of free text.

#### [Run Skill](/platform/workflows/node-reference/ai/run-skill)

Hand an open-ended task to an agent that can run code.

#### [Web Search](/platform/workflows/node-reference/web-and-http/web-search)

Gather pages from the web for the agent to reason over.

#### [Check](/platform/workflows/node-reference/logic-and-flow/check)

Turn the agent's result into a single labeled outcome.