# AI Response Generation

**AI Response Generation** runs a model and returns text (and optional structured fields) to later nodes. It does not speak. Speech is [AI Response to Caller](https://docs.voicelogica.ai/workflow-nodes/ai-response/).

  <ShotPlaceholder
    src="/assets/workflow-nodes/ai-generation.png"
    name="wn-llm"
    alt="AI Response Generation — Prompt"
    capture="LLM node on the Prompt tab. 1600×900. No emails."
  />

## Why this node

Summarize the call for an email. Classify intent before [Multiple Choice](https://docs.voicelogica.ai/workflow-nodes/multiple-choice/). Draft a note for HubSpot. Put it on [On Call End](https://docs.voicelogica.ai/workflows/on-call-end/) or [On API Call](https://docs.voicelogica.ai/workflows/on-api-call/), not on a live During graph unless you accept the wait.

## What you configure

Tabs: **Prompt**, **Model**, **Variables**.

- **Prompt** (required) — At least two characters. Insert dates, call, schedule, and node tokens.
- **Model** — Same model picker as the agent editor. Seeded.
- **Variables** — Structured values the model should fill — downstream `{{node_X.name}}`.

Ports: **Response generated**, **Generation failed**, **No wait**.

## First setup — summary into email

1. [On Call End](https://docs.voicelogica.ai/workflows/on-call-end/) → **AI Response Generation**. Prompt: write a short summary from **Call Parameters**.

     <ShotPlaceholder
       src="/assets/workflow-nodes/ai-generation-filled.png"
       name="ai-generation-filled"
       alt="AI Response Generation filled"
       capture="Workflow builder → AI Response Generation selected. Prompt tab with a call-summary prompt. 1600×900. Redact numbers/emails/PINs."
     />

2. [Send Email](https://docs.voicelogica.ai/workflow-nodes/email/) on **Response generated**. Body inserts that node’s output.

3. **Save & go live**, attach, hang up. Read the mail — if it is empty, the prompt was too thin or you inserted the wrong node.

## What “broken” looks like

- **Needs setup** — empty prompt (or shorter than two characters).
- Caller hears a pause — this node is on During Call.
- They expected the agent to *say* the text — use AI Response to Caller.

## Troubleshooting

**Why are there two AI nodes?**

**To Caller** = live audio (or Start context). **Generation** = text for Email / HubSpot / Code. Same model family, different job.

## Next Steps

[Send Email](https://docs.voicelogica.ai/workflow-nodes/email/).  
[Managed AI Agent](https://docs.voicelogica.ai/workflow-nodes/managed-agent/) — a tool loop, not one completion.  
[On Call End](https://docs.voicelogica.ai/workflows/on-call-end/).
