Procedure management and compilation produce authoring resources. Compilation returns a workflow preview; it does not save that workflow, publish an agent, or run the procedure.
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
Compile and inspect
Call Compile procedures for the intended branch. Inspect the returned
workflow, including prompts, trigger conditions, and referenced tools. Fix validation errors by their procedure ID and field path.If you want that graph in the agent, review and save it separately through the workflow and draft process.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. The compiler recognizes these step types:
The preview represents procedure instructions in workflow nodes. Review that output directly; a successful compile 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, compiled workflow previews, and agent versions are separate resources. Record which branch and draft you reviewed before changing an agent snapshot.
Why does structured content fail to compile?
Why does structured content fail to compile?
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.