Skip to content
How to add dynamic ...
 
Notifications
Clear all

How to add dynamic private key (auth) to AI Agent-triggered HTTP tool nodes?

1 Posts
1 Users
0 Reactions
7 Views
Tayyaba_TAhira
(@tayyaba_tahira)
Posts: 1
New Member
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.


:light_bulb: Goal

When a user selects a tool (e.g., update_meter_status) via the AI Agent, callin.io should perform the following:

  1. Invoke the authorization_service to retrieve a privatekey.
  2. Include this privatekey within the headers of the actual tool request.
  3. Ensure the authentication node (specifically for Private Key) is not displayed in the AI's tool selection menu.

:test_tube: What I’ve Tried (and why it failed)

  • Direct expression:
    ={{ $node["Private Key"].json[0].privatekey }}
    :small_orange_diamond: Fails unless the node has already been executed, resulting in an `undefined` or `unexecuted` error.
  • Inline `$http()` in expression:
    ={{ $http({...}).json[0].privatekey }}
    :small_orange_diamond: Not supported, as `$http` is not permitted within expressions.
  • Merge node:
    Attempted to combine AI input with the Private Key before the tool call.
    :small_orange_diamond: Does not trigger both branches; the second input typically remains unexecuted.
  • Code node to combine data:
    Manually merged the inputs.
    :small_orange_diamond: Encountered the same issue where one branch remains unexecuted.
  • Renaming node as `_internal_` to hide from menu
    :small_orange_diamond: The node still appears in the AI tool list.

:counterclockwise_arrows_button: 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

:folded_hands:

 
Posted : 22/07/2025 12:09 pm
Share: