# RunBooks

## List RunBooks

{% openapi src="/files/5e8Bzs16m2YH66PkUeuh" path="/v1alpha1/workflows" method="get" %}
[openapi2 (1).json](https://491011674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm4p7lGuBAXN5jCVyoF7P%2Fuploads%2Fd4gSHMbe5R4QikUJB1bT%2Fopenapi2%20\(1\).json?alt=media\&token=682bdaba-68cf-48bc-8748-74e3084d2806)
{% endopenapi %}

**Curl Example (to get personal runBooks: isUnskript=false)**

```bash
curl  'https://<domain>/v1alpha1/workflows?pageSize=100&isUnskript=false' \
      -H "X-unSkript-API-Key:<apikey>" 

```

**Curl Example (isUnskript=true):**

```bash
https://tenant-staging.alpha.unskript.io/v1alpha1/workflows?pageSize=100&isUnskript=true' \
-H "X-unSkript-API-Key:<apikey>"

```

## Get RunBook Details

{% openapi src="/files/5e8Bzs16m2YH66PkUeuh" path="/v1alpha1/workflows/{workflowId}" method="get" %}
[openapi2 (1).json](https://491011674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm4p7lGuBAXN5jCVyoF7P%2Fuploads%2Fd4gSHMbe5R4QikUJB1bT%2Fopenapi2%20\(1\).json?alt=media\&token=682bdaba-68cf-48bc-8748-74e3084d2806)
{% endopenapi %}

**Curl Example:**

This example gets the details of an unSkript XRunBook.  To get a custom/personal xRUnBook, use the workflowId, and remove  the isUnskript parameter.

```bash
'https://<domain>/v1alpha1/workflows/79c167af0209e60fc45455bf4943b733904d4ab8654028d8434d193d1bf8c16c?isUnskript=true' \
      -H "X-unSkript-API-Key:<apy key>" 
```

## Run a RunBook

{% openapi src="/files/5e8Bzs16m2YH66PkUeuh" path="/v1alpha1/workflows/{workflowId}/run" method="post" %}
[openapi2 (1).json](https://491011674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm4p7lGuBAXN5jCVyoF7P%2Fuploads%2Fd4gSHMbe5R4QikUJB1bT%2Fopenapi2%20\(1\).json?alt=media\&token=682bdaba-68cf-48bc-8748-74e3084d2806)
{% endopenapi %}

**Curl Example:**

This xRunBook requires no parameters.

```bash
curl  -X POST 'https://<domain>/v1alpha1/workflows/14fac589-5849-403b-afcf-ed8079099500/run' \
	-H "X-unSkript-API-Key:<apitoken>" \
-d '{"proxyId":"<proxyid>"}'
```

This xRunBook has input Parameters:

```json
curl -X POST '<domain>/v1alpha1/workflows/c5030e77-7b0a-6c4ca/run'
-H "<apitoken>"
-d '{"proxyId":"<proxyid)", "inputs":"{"tag_key":"Service","tag_value":"MongoDB", "user_name":"test123"}"}'
```


---

# 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.unskript.com/unskript-documentation/tooling/api-reference/endpoints/workflows.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.
