---
title: "Create a workflow"
method: POST
path: "/api/workflows/"
tags: ["workflows"]
---

# Create a workflow

`POST /api/workflows/`

Create a workflow. Set `type` to `automations`, `monitors`, or `evaluators` to specify the workflow kind.

## Headers

- `Authorization` string, required

## Request body

- object
  - `workflow_id` string — Optional workflow ID. Omit to let the server generate one.
  - `name` string
  - `description` string, nullable
  - `type` 'automations' | 'monitors' | 'evaluators', required — Workflow type.
  - `trigger_event_type` 'request_log' | 'trace_completed' | 'customer_budget_limit_reached' | 'credit_low_balance_threshold_reached' | 'on_eval_result_ingested' | 'custom_event' | 'eval_only'
  - `is_starred` boolean
  - `tasks` ApiWorkflowsPostRequestBodyContentApplicationJsonSchemaTasksItems[] — Workflow task definitions. Monitor tasks are typically generated by the monitor editor.
    - `id` string
    - `type` string, required — Task type such as `aggregation`, `condition`, `notification`, `webhook`, or `compute`.
    - `label` string, nullable
    - `next` string, nullable
    - `config` object

## Response `201`

Workflow created successfully

- WorkflowsCreateWorkflowResponse201
  - `id` string
  - `workflow_id` string
  - `version` integer
  - `name` string
  - `description` string, nullable
  - `type` 'automations' | 'monitors' | 'evaluators'
  - `trigger_event_type` string, nullable
  - `tasks` object[]
  - `is_enabled` boolean
  - `is_read_only` boolean
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `401` — Unauthorized - Missing/invalid authentication

---

[API](https://skmtc.dev/keywordsai/apis/api-reference.md) · [All operations](https://skmtc.dev/keywordsai/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/keywordsai/api-reference/revisions/58a2eabdccf3/schema)
