> ## Documentation Index
> Fetch the complete documentation index at: https://docs.threetone.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Procedures

> Create branch-scoped procedure drafts, review their triggers and content, and compile a workflow preview.

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.

<Note>
  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.
</Note>

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

<Steps>
  <Step title="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.
  </Step>

  <Step title="Create the resource">
    Use [Create procedure](/api-reference/agents-platform/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.
  </Step>

  <Step title="Edit the branch draft">
    Read [Get procedure draft](/api-reference/agents-platform/get-procedure-draft), then use [Update procedure draft](/api-reference/agents-platform/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.
  </Step>

  <Step title="Compile and inspect">
    Call [Compile procedures](/api-reference/agents-platform/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](/agents-platform/configure/agent-behavior/workflows).
  </Step>
</Steps>

## Free-form content

Use `free_form` when the procedure is best expressed as written instructions. For example:

```text theme={null}
Ask which product the request concerns.
Ask the user to describe the problem without sharing passwords.
Summarize the information collected and identify anything still missing.
```

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:

| Step type | Required field |
| - | - |
| `ask`, `tell` | `instruction` |
| `say` | `message` |
| `tool_call` | `tool_id` |
| `sub_procedure` | `procedure_id` |
| `system_tool` | `system_tool_name` |
| `branch` | `branches` array |

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

<AccordionGroup>
  <Accordion title="Is a procedure draft a published agent version?" id="faq-procedures-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.
  </Accordion>

  <Accordion title="Why does structured content fail to compile?" id="faq-procedures-content">
    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.
  </Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.