Skip to content
AI & Agents
Agent

writing-procedures

Check the current documentation before authoring procedure content:

From plugin
skills
5787 skills7 agents

Agent definition

writing-procedures.md

Writing Procedures

Check the current documentation before authoring procedure content:

  • [Procedures](https://elevenlabs.io/docs/eleven-agents/customization/procedures.md) — what a procedure is, and when to use one instead of a workflow or the system prompt.
  • [Free-form procedures](https://elevenlabs.io/docs/eleven-agents/customization/procedures/free-form-procedures.md) — anatomy, inline references, and how to write triggers and content.
  • [Structured procedures](https://elevenlabs.io/docs/eleven-agents/customization/procedures/structured-procedures.md) — step types, branching, and the rules on branches.

Authoring Rules

  • A procedure has a `name`, a `trigger`, and `content`. The agent uses the trigger for routing and reads the content when the procedure starts.
  • Use `free_form` for natural-language guidance that the agent can adapt. Only free-form procedures can reference knowledge base documents.
  • Use `deterministic` ("structured" in the dashboard) for typed steps that run in a fixed order, such as identity verification, escalation, or payment collection.
  • A procedure's `type` cannot change after creation. Always resend the existing `type` on a draft update. To convert between free-form and structured, create a new procedure and re-point any references to it.
  • Write concrete, non-overlapping triggers from the user's perspective. Cover likely phrasing: `When the user asks to refund, return, or get money back for an order` routes better than `When the user requests a refund`.
  • An empty `trigger` prevents trigger-based selection; the procedure can still be started by another procedure or a Start procedure workflow node. Set `trigger` as its own field; do not embed a trigger inside `content`.
  • Content is capped at 50,000 characters for both types.
  • Keep each procedure focused on one task. Put tone and refusal policy in the system prompt.
  • Extract steps shared across procedures into a separate procedure and reference it, rather than copying the steps. Copies drift.

Free-Form Content

Write `content` as markdown. Use numbered steps for sequences and bullets for requirements within a step. Use the imperative. Explain a step's rationale only when it helps the agent handle cases the procedure does not enumerate.

Reference a tool, knowledge base document, or another procedure inline. The `id` binds the resource; `name` provides a readable label.

An inline reference attaches the resource automatically. Naming a tool in prose works only when it is already attached to the agent, so prefer the markup.

1. Ask the user for their order ID.
2. Look it up with [tool id="tool_abc123" name="Get order"], because the refund window runs from the order date.
3. If the order is inside the 30-day window, check [kb id="kb_def456" name="Refund policy"] for the timeline on the payment method used and tell the user what to expect.
4. If it falls outside the window, explain why it is not eligible and offer store credit instead.
5. If the caller asks for a human at any point, run [procedure id="agtprc_xyz789" name="Escalate"].
6. Once the caller has no further questions, use [system_tool id="end_call" name="End call"].

A trigger can reference a resource's output, for example `When get_user returns tier 'gold'`.

Structured Content

Set `content` to a serialized JSON object containing a non-empty `steps` array. The trigger goes in the procedure's top-level `trigger` field, not inside `content`. Each step is an object discriminated by `type`. The step type defines its behavior, so its instruction rarely needs to restate that behavior. The names in parentheses are the labels shown in the dashboard editor.

| `type` | Editor name | Fields | Behavior | |--------|-------------|--------|----------| | `ask` | Ask | `instruction` | Asks the user something and waits. Keeps asking until the user answers. The only step that pauses for the user. | | `tell` | Tell | `instruction` | Conveys something in the agent's own words, then moves on immediately. | | `say` | Say | `message`, optional `message_translations` (`{ "<lang>": { "value": "..." } }`) | Says an exact message verbatim, then moves on immediately. | | `tool_call` | Tool | `tool_id`, `tool_name`, optional `instruction`, optional `schema_overrides`, optional `on_failure` | Calls the tool. Always calls it; a condition in the instruction cannot skip it. | | `branch` | If | `branches` (arms), optional `fallback` (Else) | Evaluates arms in order; first match wins. `fallback` runs when nothing matches. With no `fallback` and no match, control falls through to the next step. | | `sub_procedure` | Sub-procedure | `procedure_id` | Runs another structured procedure, then returns to the next step here. | | `system_tool` | System tool | `system_tool_name` | Calls a built-in tool. Only `end_call` is supported; it ends the conversation. | | `retry` | Retry | `max_retries` (1–3) | Only inside `on_failure`. Re-runs the whole failure handler, tool call included, until the tool succeeds or attempts run out. |

  • An arm in `branches` is `{ "condition": <condition>, "steps": [...] }`. A condition is `{ "type": "llm", "condition": "<natural language>" }` (a text condition the model evaluates) or `{ "type": "expression", "expression": <AST> }` (an expression over dynamic variables). Expression conditions cannot read the user's reply; they test variables filled by tool results or set at conversation start.
  • `schema_overrides` fixes a tool parameter so the model does not choose it. Keys are parameter paths; each value is `{ "source": "constant", "constant_value": ... }`, `{ "source": "dynamic_variable", "dynamic_variable": "..." }`, `{ "source": "llm", "prompt": "<optional prompt override>" }`, or `{ "source": "omit" }`.
  • `on_failure` is `{ "branches": [], "fallback": [...] }`. Today the dashboard exposes only `fallback`, a single block of steps that runs when the tool fails; keep `branches` empty. The handler's steps run and the procedure continues
Read more
@elevenlabs
Ships withskills

Agent skills for ElevenLabs developer products. These skills follow the Agent Skills specification and can be used with any compatible AI coding assistant.

Stars on GitHub

Momentum

stars in total
578
Star history of elevenlabs/skills on GitHub, a chart by star-history.com

Other agents on skills.

client-tools

client-tools

Agent

Extend your agent with custom capabilities. Tools let the agent take actions beyond just talking.

@elevenlabs@elevenlabsInstall Agent
using-procedure-api

using-procedure-api

Agent

Procedures are reusable instruction blocks that an agent runs when a trigger matches or a Start procedure workflow node starts…

@elevenlabs@elevenlabsInstall Agent

More agents from other plugins.

Argon

Argon

Agent

Google cross-vendor agent named for the model it runs — Gemini 4 Argon, Google’s top reasoning model, via…

lifeos3w20k
@danielmiessler@danielmiesslerInstall Agent

Questions about writing-procedures.

Which coding agents can use writing-procedures?
writing-procedures installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.