---
title: "Create a new flow"
method: POST
path: "/api/workers/{workerId}/flows"
tags: ["Flows"]
---

# Create a new flow

`POST /api/workers/{workerId}/flows`

## Path parameters

- `workerId` string, required

## Request body

- CreateFlowRequest
  - `name` string, required — Name of the flow
  - `code` string, required — Flow code
  - `label` string — Optional label for the flow

## Response `201`

Flow created

- Flows
  - `id` string, required
  - `version` integer, required
  - `name` string, required
  - `label` string, nullable
  - `code` string, required
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required
  - `workerId` string, required
  - `deploymentsIds` string[]

## Other responses

- `400` — Invalid request body
- `401` — Unauthorized

---

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