---
title: "Create a workflow in a Workspace"
method: POST
path: "/v1/workspaces/{workspaceID}/workflows"
---

# Create a workflow in a Workspace

`POST /v1/workspaces/{workspaceID}/workflows`

## Request

- Base URL: `https://api.plori.ai`
- URL: `https://api.plori.ai/v1/workspaces/{workspaceID}/workflows`
- Auth: HTTP bearer

Creates a draft and its Workspace association in one transaction. Requires ownership of the Workspace and enabled workflows.

## Path parameters

- `workspaceID` string, uuid, required

## Request body

- object
  - `name` string, required
  - `description` string
  - `trigger_kind` 'manual' | 'cron' | 'webhook'
  - `cron_expr` string
  - `agent_id` string, uuid: Optional creator agent owned by the same account.

## Response `201`

Workflow created in the Workspace.

- WorkspaceWorkflow
  - `id` string, uuid, required
  - `user_id` string, uuid, required
  - `agent_id` string, uuid, nullable, required
  - `workspace_id` string, uuid, nullable, required
  - `name` string, required
  - `description` string, required
  - `engine` string, required
  - `status` string, required
  - `current_version` integer, required
  - `active_version` integer, nullable, required
  - `trigger_kind` 'manual' | 'cron' | 'webhook', required
  - `cron_expr` string, required
  - `next_fire_at` string, date-time, nullable, required
  - `hook_key` string, nullable, required
  - `spend_cap_month` integer, required
  - `notify_pref` string, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `template_slug` string
  - `agent_deleted_at` string, date-time, nullable
  - `paused_reason` string

## Other responses

- `400`: Malformed request.
- `401`: Missing or invalid credential.
- `404`: No such resource.
- `409`: The Workspace is not active or the requested agent is unavailable.

---

[API](https://skmtc.dev/plori/apis/plori-rest-api.md) · [All operations](https://skmtc.dev/plori/apis/plori-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/plori/apis/plori-rest-api/revisions/15c4f9260dff?raw)
