N8n Agent: “reading message” error with Slack & Notion

Background:

Building a flow to send Slack messages to a Notion Task DB: Slack Trigger → extract text → LLM → create page (Project relation required; if no match, use COSMO-INBOX; Status = In Progress; Priority empty; Due = today).

Problem:

When using AI Agent (ToolsAgent v2), I consistently get Cannot read properties of undefined (reading ‘message’)—even if I provide message or chatInput via Code/Edit Fields and set the prompt source appropriately. The Chat Model path works; only the Agent path fails.

Env: n8n Cloud 1.115.3; Agent node v2.2.

Can you please provide an example workflow json to help reproduce the issue and figure it out?

Here’s how to do that