mute-gold•3d ago
How to Send Workflow Variables via API Request or Custom Tool to Server in Vapi.ai
I’m building a workflow with Vapi.ai. I have variables, but I can’t send them to my Node.js server using an API request. In the first node of the workflow, I capture a serviceName value. How can I send this serviceName to my server in the next node using an apiRequest? How should the properties inside the request body be structured?
Workflow JSON
{
"name": "apiRequest_1756210376400",
"type": "tool",
"metadata": {
"position": {
"x": 626.6751012694067,
"y": 1241.3795052333332
}
},
"tool": {
"type": "apiRequest",
"function": {
"name": "api_request_tool",
"description": "API request tool",
"parameters": {
"type": "object",
"properties": {},
"required": []
}
},
"messages": [
{
"type": "request-start",
"blocking": false
}
],
"name": "apiRequestCall",
"url": "https://8939cea92549.ngrok-free.app/api/callinfo",
"method": "POST",
"body": {
"type": "object",
"required": [
"serviceName"
],
"properties": {
"serviceName": {
"type": "string",
"default": "{{serviceName}}",
"description": "Service Name Value"
}
}
},
"variableExtractionPlan": {
"schema": {
"type": "object",
"required": [],
"properties": {}
},
"aliases": []
}
}
}

1 Reply
Hi, currently workflow is under development and the team is working on it.