BRANCH, an HTTP_REQUEST, an LLM_CALL or a decision plugin. For each event you list, the server starts the workflow with the event and reads how it ended.
Prerequisites: Ask for input (the approvals session) and Assign a supervisor. Defining a session and a supervisor needs an ADMIN key; add -H "X-API-Key: $YUKTA_API_KEY" to every curl if your server has keys. This guide follows example 17.
Steps
1
Write the decision workflow in an internal session
A session tagged The signal’s payload holds the event, with secrets masked, and for an input request the
"yukta.internal": "true" is internal: hidden from the default lists, and its own events never reach a supervisor. The workflow begins at SUPERVISOR_SIGNAL and ends in SUPERVISOR_DECISION nodes. Save as session.json:session.json
request (id, spec.risk, spec.kind, spec.prompt…). How the run ends decides what happens:A command the contract cannot read fails the run instead of being dropped.
AnswerInput, EscalateInput, PauseWorkflow, ResumeWorkflow, PauseNode, ResumeNode and SetPriority can always be mapped; StopWorkflow, StopNode, SkipNode, Restart, RestartFromNode, SetLimits and SetBreakpoint only when allowedCommands names them.2
Save the supervisor
supervisor.json
3
Give it something to own
4
Trigger a request
Start the
deploy workflow from Ask for input, whose request has risk LOW:Verify it worked
The run goes on without anyone answering, and ends in thedeployed terminal.
ANSWERED by the supervisor with the rationale from the workflow, the decision shows outcome applied, and the supervisors session appears only with includeInternal=true. Change the request to risk MEDIUM and start again: the workflow ends with ESCALATE, the request becomes ESCALATED with your reason as advice, and it waits for the next tier or a person. A HIGH request is never answered by a supervisor, whatever the workflow says.
Variations
- A section supervisor.
section-supervisor.jsonin the example owns onlyworkflow:my-session/my-workflow//build.*, runs a one-nodesection-triageworkflow that always endsESCALATE, and reports tolow-risk-workflowvia"parents": Build a hierarchy. - Make the decision with a model. Put an
LLM_CALL, or anMCP_TOOL_CALLthat reads other runs with aVIEWERkey, in front of the decision node (Call an LLM). - Observing internal sessions. Events of internal sessions never reach a supervisor unless its settings set
observeInternal: trueand it owns that session. Supervisors nested deeper thanyukta.supervisor.max-depth(2) are refused. - Their own slots. Supervisor runs hold one of
yukta.supervisor.reserved-slots(4) slots, so a saturated server still runs them and they cannot starve normal work. A run that finds none within its timeout is skipped. - Trusted authors. Only admins can define sessions, and a workflow can call any endpoint it holds a key for, so write these workflows as trusted code.
Related
- Supervisor engines reference for the
workflowengine. - Supervisor contract reference.
- Terminal plugins for
OUTCOME_TERMINAL, whose exitsSUPERVISOR_DECISIONshares.