Skip to main content
Procedures organize a repeatable task into named content with a trigger. Use a procedure to keep a focused process, such as gathering the information for a support request, separate from the agent’s general instructions.
Procedure management creates authoring resources. Saving an agent draft or publishing an agent validates structured procedures; neither step proves a procedure runs step by step.

Create and review a procedure

You need an existing agent, its intended branch_id, and permission to edit it. Procedure endpoints are scoped to both agent and branch.
1

Choose the procedure type

Use free_form for written instructions, deterministic for structured JSON content, or folder to organize procedures. The structured type name does not guarantee deterministic runtime behavior.
2

Create the resource

Use Create procedure. Supply a useful name, the content, and a trigger that describes when the procedure is relevant. Use folder_parent_id when placing it in a folder.
3

Edit the branch draft

Read Get procedure draft, then use Update procedure draft with the required name, content, and type. Preserve the existing type; changing it through a draft update is rejected.Keep the procedure’s completion condition and error response explicit. Avoid putting credentials or real customer records in the content.
4

Validate with an agent draft

Save an agent draft for the intended branch through the workflow and draft process. Saving checks every structured procedure. If one fails, the request answers 400, nothing is saved, and the errors name the procedure ID and field path.

Free-form content

Use free_form when the procedure is best expressed as written instructions. For example:
Keep the trigger outside the content, such as “The user wants help preparing a support request.” The written content is stored as you wrote it. It isn’t converted into separately enforced steps.

Structured content

For a deterministic procedure, content is a JSON string containing an object with a steps array. Validation recognizes these step types: Passing validation does not prove a step-by-step execution engine or successful external actions.

Frequently asked questions

No. Procedure drafts and agent versions are separate resources. Record which branch and draft you reviewed before changing an agent snapshot.
Check that the content parses as a JSON object, contains a steps array, and supplies the required field for each recognized step type. Use the returned error paths to locate the failing step.