---
title: "Create Workflow"
method: POST
path: "/workspaces/{workspace_id}/workflows"
tags: ["workflows"]
---

# Create Workflow

`POST /workspaces/{workspace_id}/workflows`

## Request

- Base URL: `https://platform.tracecat.com/api`
- URL: `https://platform.tracecat.com/api/workspaces/{workspace_id}/workflows`
- Auth: one of:
  - API key in cookie `fastapiusersauth`
  - HTTP bearer

Create a new Workflow.

Optionally, you can provide a YAML file to create a workflow.
You can also provide a title and description to create a blank workflow.

## Path parameters

- `workspace_id` string, uuid, required

## Request body `multipart/form-data`

- BodyWorkflowsCreateWorkflow
  - `title` string, nullable
  - `description` string, nullable
  - `use_workflow_id` boolean: Use the workflow ID if it is provided in the YAML file
  - `file` string, binary, nullable

## Response `201`

Successful Response

- WorkflowReadMinimal: Minimal version of WorkflowRead model for list endpoints.
  - `id` string, required
  - `title` string, required
  - `description` string, required
  - `status` string, required
  - `icon_url` string, nullable, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `version` integer, nullable, required
  - `tags` TagRead[], nullable
    - `id` string, uuid, required
    - `name` string, required
    - `ref` string, required: Slug-like identifier derived from name, used for API lookups
    - `color` string, nullable: Hex color code
  - `alias` string, nullable
  - `error_handler` string, nullable
  - `latest_definition` WorkflowDefinitionReadMinimal
    - `id` string, uuid, required
    - `version` integer, required
    - `created_at` string, date-time, required
  - `folder_id` string, uuid, nullable
  - `trigger_summary` WorkflowTriggerSummary
    - `schedule_count_online` integer
    - `schedule_cron` string, nullable
    - `schedule_natural` string, nullable
    - `webhook_active` boolean
    - `case_trigger_events` CaseEventType[]

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/tracecat/apis/tracecat-api.md) - [All operations](https://skmtc.dev/tracecat/apis/tracecat-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tracecat/apis/tracecat-api/revisions/2efdda25045f?raw)
