I’m trying to store a value (resultId) early in my workflow and reuse it later, even after it gets lost or becomes null during intermediate steps like the AI Agent node. Specifically, I need to:
- Capture resultId from the Webhook payload.
- Save it so I can use it persistently throughout the workflow, even if subsequent nodes (like AI Agent) overwrite or remove it.
- Reference resultId dynamically in an HTTP Request Node to construct a URL.
What I’ve Tried:
- Using $flow.set() and $flow.get():
This works temporarily during the workflow execution but doesn’t persist after the AI Agent step.
- Using Static Workflow Data (getWorkflowStaticData):
I attempted to save the resultId globally with:
const staticData = this.getWorkflowStaticData('global');
staticData.savedResultId = $json.body.resultId;
return $json;
And retrieve it later with:
const staticData = this.getWorkflowStaticData('global');
return { savedResultId: staticData.savedResultId };
However, this didn’t work for constructing the dynamic URL in the HTTP Request Node.
- Item Matching:
Tried saving the resultId in a Set Node and passing it dynamically, but it still became undefined in the later steps.
Current Workflow Design:
Webhook Node: Receives the initial payload with body.resultId.
Set/Code Node: Saves resultId for later use.
AI Agent Node: Performs processing but causes resultId to become null.
HTTP Request Node: Needs resultId to construct the URL:
https://typebot.co/api/v1/typebots/.../results/{{ savedResultId }}/executeWebhook
Key Issue: I cannot reliably persist resultId through the workflow, especially when intermediate nodes like the AI Agent overwrite or remove it.
What I Need: A simple way to:
- Save resultId early in the workflow (e.g., from the Webhook payload).
- Ensure it’s accessible later, regardless of what intermediate nodes do.
- Dynamically reference it in the HTTP Request Node.