Name
Each node name must be unique within the scenario. The node name is used as the identifier for:initial_node(the scenario start node)- any function
transition_totargets
initial_nodeif that node is currently the start node- any function transitions that point to that node
Global role instruction
Scenarios use one globalrole_instruction at the top level.
Use role_instruction for long-lived identity, tone, boundaries, and behavior that should apply across the full conversation.
JSON
Task instruction
task_instruction defines what the assistant should do in the current node.
Each node must include one non-empty task_instruction.
Recommended pattern:
- Put long-lived persona and behavior rules in the global
role_instruction - Use
task_instructionin each node for node-specific goals and instructions
Runtime variables in instructions
You can embed{{runtime.*}} placeholders in the global role_instruction and in any node’s task_instruction. Akapulu Labs substitutes them from the runtime_vars your server sends on connect, so the model sees session-specific text without you duplicating scenarios per customer.
secret and llm template variables are not supported in role_instruction or task_instruction. Use {{runtime.*}} for per-session variables; keep sensitive variables in endpoint headers with {{secret.*}}, and use {{llm.*}} only in HTTP endpoint templates. See Templates and Variables.runtime_vars, for example company_name, user_id, and display_name.
Web SDK: If using the Akapulu Labs Web SDK, in your connect route, call
akapulu.connectConversation from @akapulu/server with a runtime_vars object whose keys match your {{runtime.*}} placeholders. See Customize Conversation UI for a complete server-side example.Functions
Functions are tool calls available to the assistant while the node is active. Allowed function types:transitionhttpragvision
- function name is required and must be unique within the node
- function name can only use letters, numbers, underscores, and hyphens
- function description is required
transitionrequirestransition_tohttprequiresendpoint_idragrequiresknowledge_base_idvisionhas no additional required ID field
- this is the instruction shown to the model for when and why to call the tool
- be explicit about the trigger, expected use, and what the tool does
- enter a function
name - enter a function
description - select type-specific targets from the dropdowns (saved HTTP endpoint for
http, knowledge base forrag)
transition_to in the UI for any function, drag the probe on the right side of the function to the desired node.
Require function call
require_function_call makes the assistant call at least one function on the next model turn in this node instead of answering with only plain text.
Constraint: When
require_function_call is true, the node must define at least one function in functions.Loop protection: If
require_function_call is enabled and the assistant gets stuck repeatedly calling tools without replying in text, Akapulu Labs automatically relaxes the forced-call requirement after 5 consecutive tool-only turns for that session/node. After that, the assistant can either call a tool or reply in plain text to prevent infinite loops.Respond immediately
respond_immediately controls whether the assistant speaks immediately after entering the node.
true(default): the assistant responds right awayfalse: the assistant waits for user input before responding
End after bot response
end_after_bot_response controls whether the conversation ends after the bot finishes its first utterance in that node.
Use this for terminal nodes like wrap-up, goodbye, or confirmation nodes where the assistant should speak once and then end the conversation.
When end_after_bot_response is true, interruptions are disabled for that node so the bot can finish its closing response before the conversation ends.
JSON

