---
title: "Execute a playbook"
method: POST
path: "/workspace/{ws_id}/playbooks/{id}/execute"
tags: ["Workflows"]
---

# Execute a playbook

`POST /workspace/{ws_id}/playbooks/{id}/execute`

Starts execution of the specified playbook.
By default, the execution runs asynchronously and returns the execution ID immediately.
Use the `run_sync` parameter to wait for the execution to complete and return the output directly.
**Note**: When running synchronously, the request will block until the playbook completes or times out.

## Path parameters

- `id` string, required
- `ws_id` string, required

## Query parameters

- `run_sync` boolean
- `timeout` integer

## Request body

- PlaybookInputsPlaybookInputParamValues
  - `callback` PlaybookInputsWorkflowCallback
    - `body` object
    - `cookies` object
    - `disableSSL` boolean
    - `excludeDefaultMetadata` boolean
    - `headers` object
    - `method` string
    - `url` string
  - `event` object — The data that is used on an event-based workflow
  - `input_values` object — Input parameters that will be used by the workflow
  - `past_exec_ref` string — The ID of a previous execution, used when rerunning
  - `runner` string — The runner group that will run the workflow
  - `trigger_type` string — The type of the trigger of the workflow

## Response `200`

Execution ID when running asynchronously, or playbook output when running synchronously

- ApiDocsExecuteWorkflowOutput
  - `execution_id` string — The ID of the created execution

## Other responses

- `400` — Invalid request parameters or input validation failed
- `404` — Playbook not found

---

[API](https://skmtc.net/blinkops/apis/blink-rest-api.md) · [All operations](https://skmtc.net/blinkops/apis/blink-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/blinkops/blink-rest-api/versions/f043409736b2/schema)
