# Runbooks

<figure><img src="https://982123570-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9hXBoCTTNw5flARlUVJf%2Fuploads%2FKAUr5l2VyllGLrC3BzEy%2FCleanShot%202025-06-05%20at%2016.10.13.png?alt=media&#x26;token=b496783f-2145-4de4-ba64-534603eb3d69" alt="" width="563"><figcaption><p>A runbook for handing hardware failure issues</p></figcaption></figure>

Write instructions in natural language to help your AI Agent handle specific scenarios. When your AI Agents are assigned to issues, they will determine the most relevant runbook they have access to and start executing it.

You can think of Runbooks as having the power of programming, but with the simplicity of writing a document with steps.

## Actions

Agents have the ability to perform actions inside and outside Pylon. On the [Actions](https://app.usepylon.com/settings/ai-controls/actions) page in Settings, view all the actions available to the agent and configure additional custom actions, like API calls.

<figure><img src="https://982123570-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9hXBoCTTNw5flARlUVJf%2Fuploads%2FDWLnvmYUjnPWQ7dTWiQK%2FCleanShot%202025-02-16%20at%2010.47.02%402x.png?alt=media&#x26;token=d59243d8-db57-4870-9ac7-2465c4f48302" alt=""><figcaption><p>Example of GET API call definition</p></figcaption></figure>

By default, AI Agents have a whole set of Pylon actions available to them, including responding to customers, leaving internal notes, setting custom fields, and more.

## Variables

Actions and Runbooks allow scoped variables available to make your Runbook execution as flexible as possible. These variables can exist only in the Runbook or come from other fields in Pylon. For example, you can use variables in the body of API calls or as a way to pass information between steps in a Runbook. Use the `{{` characters to see available variables or create a new one.

<figure><img src="https://982123570-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9hXBoCTTNw5flARlUVJf%2Fuploads%2FcKfVL6etPIZsiXOgH7RQ%2FCleanShot%202025-02-16%20at%2010.51.04%402x.png?alt=media&#x26;token=41b923b6-3879-467b-956c-91c9f6c65b24" alt="" width="375"><figcaption></figcaption></figure>

## Steps

Runbooks consist of a sequence of steps that each use actions, variables, and natural language.&#x20;

Chain together steps to create an end-to-end workflow for how an Agent should handle a certain scenario.

{% hint style="info" %}
Runbooks can involve customer interaction or be fully internal facing!
{% endhint %}

Here's an example of a Runbook step:

<figure><img src="https://982123570-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9hXBoCTTNw5flARlUVJf%2Fuploads%2FCZdY1Q0O2Sq4RijY0cFy%2FCleanShot%202025-02-16%20at%2011.06.39%402x.png?alt=media&#x26;token=9bae5a0e-c057-4586-9e4e-eb6fb0260e0f" alt=""><figcaption></figcaption></figure>

Note that since the step is in natural language, mentioning the account ID is a 5 digit alphanumeric value means we get natural enforcement and validation from the AI. For example, if the user provides something 6 digits long, the AI will re-prompt them with a suggestion for the correct prompting.&#x20;

{% hint style="info" %}
It will take some iterating to prompt the AI in the manner that's best for the workflow you are trying to create!
{% endhint %}

## Testing

Runbooks can also be tested in isolation of AI agents using the tester on the runbook page.&#x20;

<figure><img src="https://982123570-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9hXBoCTTNw5flARlUVJf%2Fuploads%2FusyMtX7Iv3dhARIZPTzo%2FCleanShot%202025-06-05%20at%2023.31.53.gif?alt=media&#x26;token=f7cda460-c730-472d-a036-f9b4182d9f22" alt=""><figcaption></figcaption></figure>

## Human-guided Runbooks

Runbooks can not only be executed directly by AI agents, but also by humans on your team directly. Runbooks are accessible in the [copilot](https://docs.usepylon.com/pylon-docs/support-workflows/issues/copilot "mention") tab of the issue sidebar, and will be suggested by [#issue-suggestions](https://docs.usepylon.com/pylon-docs/support-workflows/issues/copilot#issue-suggestions "mention").

A team member can then directly step through exection of steps in the runbook, guided by the AI copilot.

<figure><img src="https://982123570-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9hXBoCTTNw5flARlUVJf%2Fuploads%2FAke4F1xheGO2aBRVHUgw%2FCleanShot%202025-06-06%20at%2020.59.40.gif?alt=media&#x26;token=ef411b34-bda9-4327-9c59-4fbaa3b67e13" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.usepylon.com/pylon-docs/ai-agents/build/runbooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
