Smart Call Function Tool
AI-generatedOverview
The Smart Call Function Tool node enables AI agents to invoke n8n Function nodes dynamically within workflows. It acts as a bridge allowing AI-driven automation or decision-making processes to call predefined functions in other workflows, passing parameters either provided by the AI or set manually.
This node is particularly useful when you want to:
- Integrate AI models with custom business logic encapsulated in Function nodes.
- Allow AI agents to execute complex operations defined in workflows without hardcoding calls.
- Dynamically configure function parameters for flexible and context-aware automation.
Example use cases:
- An AI chatbot that calculates taxes by calling a tax calculation function node with user-provided amounts.
- Automating data transformations where an AI decides which function to call and what parameters to pass based on conversation context.
- Extending AI capabilities by leveraging existing workflow functions as callable tools.
Properties
| Name | Meaning |
|---|---|
| ℹ️ This tool allows AI agents to call Function nodes. You can configure each parameter to be provided by the AI agent (required/optional) or set with a fixed value. | Informational notice describing the node's purpose. |
| Set Custom Function Name | Boolean flag to override the default function name visible to the AI agent. If false, the Function node's actual name is used. |
| Custom Function Name | The custom name to present to the AI agent if overriding is enabled. Example: calculate_tax. |
| Set Custom Function Description | Boolean flag to override the default function description visible to the AI agent. If false, the Function node's actual description is used. |
| Custom Function Description | The custom description to present to the AI agent if overriding is enabled. Example: Calculate the total price including tax for a given amount. |
| Workflow | Selector to choose the workflow containing the target Function node to call. This is required. |
| Function Name or ID | Dropdown or expression to select the specific Function node within the chosen workflow to call. Required. |
| Parameter Configuration | Option to let the AI model decide all function parameters automatically (auto), or manually configure each parameter's source (manual). |
| Function Parameters | When manual configuration is selected, this collection lets you specify for each parameter whether it is required or optional from the AI model, or if it should use a fixed hard-coded value. Each parameter includes: - Parameter Name or ID - Value Provided: • By Model (and Is Required) • By Model (but Is Optional) • Using Field Below - Fixed Value (if applicable) |
Output
The node outputs a single output named ai_tool containing JSON data structured as follows:
response: The result of the called Function node execution.- If the function returns data, it is serialized as a JSON string.
- If no data is returned, a success message string is provided.
The output JSON reflects the function's response, enabling downstream nodes or AI agents to consume the results.
No binary data output is produced by this node.
Dependencies
- Requires access to the selected workflow and its active Function nodes.
- Depends on a Function Registry service internally to discover available functions and their parameters.
- Uses a Function Call Service to execute the target function with merged parameters.
- Requires proper permissions and API authentication to access and invoke workflows/functions.
- No external third-party APIs are directly called by this node, but the invoked Function nodes may have their own dependencies.
Troubleshooting
Common Issues
- No workflow selected: The node will throw an error if no workflow is selected.
- No valid function selected: Errors occur if the function name is invalid, missing, or the workflow has no active Function nodes.
- Missing required parameters: If AI input does not provide all required parameters (in manual mode), the node throws an error specifying which parameter is missing.
- Invalid input format: Input to the function must be a JSON object or a stringified JSON representing parameters. Invalid formats cause errors.
- Function call failure: If the underlying function execution fails, the node surfaces the error message.
Error Messages and Resolutions
"Please select a workflow first."— Select a valid workflow containing Function nodes."Please select a valid function..."— Choose a valid Function node from the dropdown; ensure the workflow is active."Missing required parameter: <paramName>"— Provide all required parameters either via AI input or fixed values."Invalid input format. Expected JSON object with parameters: ..."— Ensure the input to the function is correctly formatted JSON."Function call failed: <error message>"— Check the target function's logic and inputs; review logs for detailed errors.
Links and References
- n8n Expressions Documentation
- n8n Workflow Selector Documentation
- Function Node Documentation
- AI Tools in n8n
This summary is based solely on static analysis of the provided source code and property definitions.