Use this guide when you want to create or edit a scenario directly in JSON. Use the toggle in the top-right corner of the scenario page to switch between visual mode and JSON mode.Documentation Index
Fetch the complete documentation index at: https://docs.akapulu.com/llms.txt
Use this file to discover all available pages before exploring further.
JSON shape
Every scenario JSON must include:initial_node: the name of the start nodenodes: an object keyed by node namerole_instruction: one global system instruction for the full scenario
Top-level fields
initial_nodeis required and must match an existing node name.role_instructionis optional and applies globally across the whole conversation.
Node fields
Each node can include:task_instruction(required): the instruction for what the assistant should do in that nodefunctions(optional): tools available in this noderespond_immediately(optional boolean): whether the assistant responds immediately after entering the node. Defaults totrueend_after_bot_response(optional boolean): whether the conversation should end after the bot finishes its response in that noderequire_function_call(optional boolean): whentrue, the assistant must call at least one function from this node’sfunctionslist. Defaults to omitted / off
Function shape
Functions are defined directly under a node’sfunctions list:
type values:
transitionhttpragvision
Function type schemas
transition
name: unique function name in the nodedescription: instruction shown to the LLM that explains when to call this functiontype: must betransitiontransition_to: target node name to move torequire_reason(optional boolean): whentrue, the LLM must pass areasonargument when calling the tool. The reason appears in the tool-call payload in the transcript. Useful for debugging transitions, adds a small amount of latency. See Transition Tools
http
name: unique function name in the nodedescription: instruction shown to the LLM that explains what the endpoint does and when to call ittype: must behttpendpoint_id: ID of a saved HTTP endpoint in your account
rag
name: unique function name in the nodedescription: instruction shown to the LLM that explains what knowledge this tool retrieves and when to use ittype: must beragknowledge_base_id: ID of a saved knowledge base in your account
vision
name: unique function name in the nodedescription: instruction shown to the LLM that explains when to inspect user video contexttype: must bevision
transition_to is optional for non-transition tools. If set, the flow will transition to the specified node on tool completion
For HTTP functions, there are two transition patterns:
- Use
transition_towhen the endpoint should always move to the same next node after a successful response. - Use
allowed_next_nodesto have Akapulu choose the next node dynamically from the function response. (See Endpoints)
Validation rules
Core structure
nodes_jsonis required and must be a JSON objectnodes_jsonmax size is20000characters- top-level keys are limited to
initial_node,role_instruction, andnodes nodesmust be a non-empty objectinitial_nodeis required and must match an existing node nameinitial_nodemust reference a node object
Instruction rules
role_instruction, if provided, must be a non-empty stringtask_instructionmax length:4000charactersrole_instructionmax length:4000characterstask_instructionandrole_instructioncannot usesecretorllmtemplate variables
Node rules
- each node must be a JSON object
- node keys are limited to
task_instruction,functions,respond_immediately,end_after_bot_response, andrequire_function_call - every node must include a non-empty
task_instruction respond_immediately, if provided, must be a booleanend_after_bot_response, if provided, must be a booleanrequire_function_call, if provided, must be a boolean- if
require_function_callistrue,functionsmust be a list with at least one function - if
functionsis provided, it must be a list
Function rules
functionsmust be a list of direct function objects- each function must be a JSON object
- function keys are limited to
name,description,type,transition_to,allowed_next_nodes,endpoint_id,knowledge_base_id,parameters, andrequire_reason function.nameis required, must be unique per node, and only allows letters, numbers,_,-function.namecannot include leading or trailing whitespacefunction.descriptionis requiredfunction.typemust be one oftransition,http,rag,visionand defaults totransitionif omitted
Transition rules
transitionfunctions must definetransition_totransition_tomust be a stringtransition_tomust not include leading or trailing whitespace- if
transition_tois set, it must target an existing node require_reason, if provided, must be a booleanrequire_reasonis only valid fortransitionfunctions
HTTP function rules
httpfunctions must defineendpoint_idallowed_next_nodesis only valid forhttpfunctionshttpfunctions cannot set bothtransition_toandallowed_next_nodes- if
allowed_next_nodesis set, it must be a non-empty JSON array - each
allowed_next_nodesentry must be a non-empty string allowed_next_nodesentries must not include leading or trailing whitespaceallowed_next_nodesentries must be unique- each
allowed_next_nodesentry must reference an existing node - referenced HTTP endpoints must exist in your account
RAG function rules
ragfunctions must defineknowledge_base_id- referenced knowledge bases must exist in your account
HTTP template rules
- endpoint
headersandbodymust be JSON objects - endpoint header values must be strings
- endpoint body values must be strings
- secret variables are not allowed in endpoint body templates, so put secrets in headers
- template variables must use valid
runtime,secret, orllmsyntax llmvariables must include descriptions- the same
llmvariable name cannot use conflicting descriptions within one function
Example scenarios
Replace placeholder IDs like<KNOWLEDGE_BASE_ID> and <HTTP_ENDPOINT_ID> with values from your Akapulu account.

