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 intendedbranch_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
Usefree_form when the procedure is best expressed as written instructions. For example:
Structured content
For adeterministic 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
Is a procedure draft a published agent version?
Is a procedure draft a published agent version?
No. Procedure drafts and agent versions are separate resources. Record which branch and draft you reviewed before changing an agent snapshot.
Why does structured content fail validation?
Why does structured content fail validation?
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.