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 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 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

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

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.” Compilation places the written content in a workflow node’s additional prompt. It does not convert each sentence into a separately enforced step.

Structured content

For a deterministic 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

No. Procedure drafts, compiled workflow previews, 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.