I’m facing an issue where my Custom Function (GET method) is not receiving the dynamic variable from the preceding “Extract Variables” node in my Conversation Flow.
The Setup:
Extract Variables Node: Correcty extracts a 6-digit number and saves it into a variable named task.
Custom Function Node: Uses the GET method. In the “Query Parameters” section, I have configured:
Key: task
Value: {{task}}
API Endpoint: A PHP script that expects search.php?task=NUMBER.
The Problem: When testing the agent, the “Tool Invocation” log for extract_dynamic_variables shows success: {"task":"205601"}. However, the subsequent “Tool Invocation” log for my custom function shows empty arguments: {}.
Because the arguments are empty, the API does not receive the task number, and the LLM hallucinations a response instead of using real data.
What I’ve tried:
Verified that the variable name in the Extraction node matches the one in the Function node (task).
Manually typing {{task}} in the Query Parameter value field
Ensuring there are no spaces within the double curly braces.
Is there a specific way to force the Function node to recognize the session variable in the Conversation Flow interface? It seems like the variable context is lost between the Extraction and the Function call.
Based on the documentation and community discussions, there’s a known issue with how dynamic variables work in Custom Functions with GET requests in Conversation Flow.
The Root Cause:
When you extract variables using the Extract Dynamic Variables node, those variables are saved to the session context(1). However, for Custom Functions with GET requests, there’s a specific configuration requirement for query parameters(2).
The Solution:
In your Custom Function’s Query Parameters section, you need to configure both the parameter description AND ensure the variable is properly referenced. Based on community troubleshooting, try this approach(3)(4):
Make sure the Extract Variables node runs before your Custom Function node in the flow(5)
Verify the variable name matches exactly (case-sensitive) between extraction and usage(5)(4)
Important Notes:
Query parameters can include dynamic variables, and there’s a switch to change between parameter description or const value(2)
Both description and const value can use dynamic variables(2)
The description will be resolved by the LLM while const value will be applied directly to the function(2)
Verification:
After making these changes, check your call logs. You can verify if the variable was properly extracted by looking at the collected_dynamic_variables field in your call details(6)(5).
If the issue persists after these adjustments, the call logs should show whether the variable has a value when the tool is invoked(5).