I tested with chat and built in app agent ai works without issue but if data
is coming from the webhook and you add response webhook
ai agent doesn’t execute the node
Any idea or is this a bug?
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
The agent only knows about the nodes underneath it, not the nodes to the right.
If you want the ‘book appointment’ step to always happen, better to put it as a regular (square) node in between the agent and the ‘respond to webhook’. You can then get the agent to output the details of the booking and wire them up.
I could do that and won’t have an issue but I trying to see why agent AI is not handling that part when using webhook. When I used chat or telegram it works
so I find it weird
P.S. I am running the same post data which is {"email": "[email protected]"}
The issue is likely due to how the AI agent processes and executes tools within n8n. Since the AI agent only knows about the nodes beneath it, but not the ones to the right, it might not be triggering the book_appointment tool properly before the Respond to Webhook step.
Fix: Restructuring the Workflow
Steps to Fix It
Move the book_appointment tool into the main execution path
Instead of relying on the AI agent to call the book_appointment tool, insert it as a regular node between the AI agent and Respond to Webhook.
This ensures that book_appointment will always execute before the webhook responds.
Modify the AI agent’s output
Make sure the AI agent outputs structured data containing the appointment details.
Connect the output of the AI agent to the book_appointment node.
Ensure Execution Order
Connect the book_appointment node output to Respond to Webhook, so it only executes after the appointment is booked.
Updated Flow Structure
Webhook → 2. AI Agent → 3. Book Appointment Node (Direct Execution, Not via AI Tool Call) → 4. Respond to Webhook
This structure guarantees that the appointment booking happens before responding to the webhook.
Would you like me to help modify your workflow with step-by-step changes? this was a chat gpt reply
Agents can be unreliable with complicated instructions. Could it be that whether your agent calls the tool isn’t related to whether there’s a webhook but down to the natural variability of what the agent chooses to do?
In general you should try to make the instructions to AI as simple as possible. So if you want it to call 3 tools in a certain order, turn them into a single tool that always does that.
You can do that by creating a sub-workflow with regular (square) nodes that perform your three actions in sequence, and adding that workflow as a tool for the agent.