Notifications
Clear all
How To
1
Posts
1
Users
0
Reactions
7
Views
Topic starter
Hello team,
I'm currently developing a workflow using callin.io's AI Agent with Langchain and HTTP request tool nodes. My objective is to dynamically inject a privatekey
obtained from an authentication request into the headers of subsequent tool API calls, but I'm encountering some difficulties.
Goal
When a user selects a tool (e.g., update_meter_status
) via the AI Agent, callin.io should perform the following:
- Invoke the
authorization_service
to retrieve aprivatekey
. - Include this
privatekey
within the headers of the actual tool request. - Ensure the authentication node (specifically for
Private Key
) is not displayed in the AI's tool selection menu.
What I’ve Tried (and why it failed)
- Direct expression:
={{ $node["Private Key"].json[0].privatekey }}
Fails unless the node has already been executed, resulting in an `undefined` or `unexecuted` error.
- Inline `$http()` in expression:
={{ $http({...}).json[0].privatekey }}
Not supported, as `$http` is not permitted within expressions.
- Merge node:
Attempted to combine AI input with the Private Key before the tool call.Does not trigger both branches; the second input typically remains unexecuted.
- Code node to combine data:
Manually merged the inputs.Encountered the same issue where one branch remains unexecuted.
- Renaming node as `_internal_` to hide from menu
The node still appears in the AI tool list.
What I’m Looking For
- A method to automatically execute an internal authentication node prior to any AI-selected tool being invoked.
- The ability to keep this authentication node hidden from the tool menu.
- The capability to reuse the obtained
privatekey
in all subsequent HTTP headers.
Are there any straightforward solutions for this pattern? Perhaps utilizing workflow context, a credentials trick, or hidden pre-execution hooks?
I greatly appreciate any guidance you can offer. I'm happy to share the full workflow JSON if needed!
Thanks
Posted : 22/07/2025 12:09 pm