The idea is:
Add an optional flag parameter to the $fromAI()
function in N8N’s AI Agent nodes, allowing parameters to be marked as optional. This would enable the AI agent to decide whether to populate the field based on context, rather than being forced to provide a value (even if empty).
$fromAI(key, description?, type?, defaultValue?, isOptional?)
My use case:
For a project manager agent, when creating a task, only the task name might be required, while fields like assignee
, projectId
, or dueDate
could be optional. Currently, the agent must fill all parameters marked with $fromAI()
, even if the information is unavailable or irrelevant. With optional parameters, the agent could create tasks with partial data (e.g., just the name) and leave optional fields unpopulated.
$fromAI("assignee", "Who to assign the task to", "string", null, true)
I think it would be beneficial to add this because:
-
Critical for Real-World Agent Reliability
Optional parameters would let agents skip fields they cannot resolve, aligning with how humans interact with APIs/forms. -
Unlocks Advanced Use Cases
Without optional parameters, users cannot build agents for:- Progressive data collection (e.g., create a task now, assign it later).
- Adaptive workflows (e.g., skip
dueDate
if the user says “ASAP”). - Multi-step tools (e.g., update only specific fields of a task).
-
Alignment with Industry Standards
Competing platforms like Relevance AI already support optional parameters in their agent tools. N8N risks falling behind in AI automation adoption if basic flexibility is missing. -
Reduces Technical Debt
Users currently work around this limitation by:
Creating duplicate tools (e.g.,create_task_with_assignee
andcreate_task_without_assignee
), increasing maintenance.
Any resources to support this?
- LangChain’s optional Tool parameters also allow similar flexibility.
Are you willing to work on this?
While I cannot contribute code directly. I hope the N8N community and team will prioritize this feature!
AI Agents are gaining momentum, think about it ! Thanks