I’ve been rebuilding the way I give AI agents tools in n8n, and honestly, this is the cleanest approach I’ve used so far.
The unlock is {{ $fromAI() }}.
Before this, my usual setup was:
Agent gets the user request → passes it into another workflow/tool → OpenAI or a code step parses the request → maps fields perfectly into something like Gmail or Calendar.
It worked. But it was also fragile.
If the parser returned sendTo instead of send to, or changed the structure slightly, the whole thing could fall over. A lot of agent builds ended up being less about what the agent should do and more about babysitting parameter formatting.
Now I’m skipping a lot of that.
Instead of building extra parsing layers, I can let the node handle it directly with fromAI. So inside a Gmail node, I can define fields like:
- email address
- subject
- message
And the AI figures out what belongs in each one from the user’s request.
That means fewer helper workflows, fewer brittle mappings, and way faster setup.
A simple example:
If I tell an agent:
Send an email to Michael Scott asking if he wants to get lunch today
I can let the Gmail node infer:
- who the email goes to
- what the subject should be
- what the body should say
Same thing with Calendar.
I can drop fromAI into the start time, end time, and event title fields, and the agent can turn a natural language request into a real event without me manually building a parser in between.
That’s the part I like most: less orchestration, more execution.
The function itself is also pretty simple. The main thing is the key, and then you can optionally add things like a description, type, and default value.
So if I want a node to pull a customer name, I can tell it to look for a name. If I want a number, I can set the type accordingly. If I want a fallback so the automation doesn’t break, I can give it a default.
That little pattern makes these tool calls way more resilient.
What I’d actually do in production is still keep some constraints in place. I wouldn’t hand one agent 30 random tools and hope for the best. I’d still break things into focused agents or at least focused toolsets.
But for things like:
- email actions
- calendar actions
- Airtable updates
- Slack messages
- structured field inputs
fromAI is a huge quality-of-life upgrade.
I’m always looking for the shortest path between an idea and a working automation, and this feels like one of those features that removes a lot of unnecessary glue code.
Not because it’s flashy. Because it cuts steps.
That’s usually the stuff that actually ships.
If you’re building agents in n8n and you’re still routing every tool through a separate parsing workflow first, I’d seriously test this pattern. It’s faster to stand up, easier to maintain, and a lot more forgiving than the old “map every field perfectly or break everything” approach.
I’m betting this becomes the default way a lot of us wire agent tools going forward.