Tool only runs once needs to run multiple times

n8n Community Post: AI Agent Only Validates First Field, Skips Subsequent Validations

Issue Description

I’m building an AI agent workflow to collect customer information (name, phone, email) with validation. The agent successfully validates the name field using the inputValidatorWebhook tool, but then skips validation entirely for phone and email fields, proceeding directly to the next phase without calling the validation tool.

Expected Behavior

The agent should:

  1. Ask for name → Call inputValidatorWebhook with type=“name” → Store formatted result

  2. Ask for phone → Call inputValidatorWebhook with type=“phone” → Store formatted result

  3. Ask for email → Call inputValidatorWebhook with type=“email” → Store formatted result

  4. Return all three validated values

Actual Behavior

The agent:

  1. :white_check_mark: Asks for name → Calls inputValidatorWebhook with type=“name” → Stores formatted result

  2. :cross_mark: Asks for phone → Skips validation tool → Proceeds to email question

  3. :cross_mark: Asks for email → Skips validation tool → Exits without validating

System Prompt Structure

markdown

### Step 2: Collect Customer Phone

Ask: "What is the customer's phone number?"

Wait for user response.

**When user provides input:**
1. Call `inputValidatorWebhook` with:
   - type: "phone"
   - value: [user's input]
2. Wait for tool response

**Process validation response:**
[validation logic here]

### Step 3: Collect Customer Email

Ask: "What is the customer's email address?"

Wait for user response.

**When user provides input:**
1. Call `inputValidatorWebhook` with:
   - type: "email"
   - value: [user's input]
2. Wait for tool response

**Process validation response:**
[validation logic here]

What I’ve Tried

  • Verified the tool is configured correctly (works for name field)

  • Added explicit “CRITICAL RULES” stating validation must happen for all fields

  • Used identical prompt structure for all three fields

  • Confirmed the agent reaches Step 2 and Step 3 (asks the questions)

Question

Why would the AI agent call the validation tool for the first field but not for subsequent fields, even when the prompt instructions are identical? Is there a way to force sequential tool execution for each step, or does this suggest an issue with how the agent maintains context across multiple tool calls?

Any insights would be appreciated!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.