# Structured Procedures

A Structured Procedure compiles authored steps into a deterministic runtime graph. It is suited to regulated checklists, required data collection, exact notices, and controlled Tool execution.

## Build the sequence

Set the name and trigger, then add steps. **Ask** generates a question from an instruction and waits for the next customer message. **Tell** generates a response from an instruction but does not automatically wait. **Say** emits the exact authored message. **Tool** calls one selected webhook Tool. **If** chooses one branch. **End** either closes the conversation or returns. **Sub-procedure** inlines another Procedure and later returns to the caller.

Steps are executed in authored order. An If branch rejoins the following step unless an End changes control flow. Sub-procedures are expanded when readiness is checked; cycles and missing references are rejected.

## Waiting and returning

Ask is the normal pause boundary: Operade stores the current internal node and resumes it when the customer replies. Tell and Say continue automatically, so long automatic sequences should be short. An End step with **End conversation** enabled closes the conversation. With the option off, the current Procedure returns to its caller, Agent, or Workflow.

The runtime allows no more than 20 consecutive automatic Procedure steps before a wait, and expanded authored execution is capped at 100 steps. These limits prevent silent loops and excessively large compiled graphs.

## Validate before publishing

Draft autosave accepts incomplete work and displays field-level readiness errors. Publish and Test chat require instructions, messages, Tool IDs, branch expressions, and Sub-procedure references to be valid. Missing Tools are rechecked at runtime as well.

See the complete [step reference](/docs/procedures/steps) and [runtime troubleshooting](/docs/procedures/runtime-and-troubleshooting).
