---
title: "Create a flow"
method: POST
path: "/flows"
tags: ["Flows"]
---

# Create a flow

`POST /flows`

Create a flow that binds a trigger (`triggerId`) to an ordered list of actions, with at least one action required. Optional settings include target `deviceIds`, a cooldown (`cooldownSeconds`/`cooldownScope`), and webhook notifications on success or failure.

## Request body

- CreateFlowBody
  - `name` string, required
  - `description` string
  - `triggerId` string, uuid, required
  - `enabled` boolean
  - `deviceIds` string[]
  - `cooldownSeconds` integer, nullable
  - `cooldownScope` 'flow' | 'device'
  - `notifyWebhookId` string, uuid, nullable
  - `notifyOnSuccess` boolean
  - `notifyOnFailure` boolean
  - `actions` FlowActionInput[], required
    - `actionId` string, uuid, required
    - `position` integer, required
    - `continueOnError` boolean
    - `nameOverride` string
    - `overrides` FlowActionOverrides, nullable
      - `params` object
    - `children` FlowChildActionInput[]
      - `actionId` string, uuid, required
      - `position` integer, required
      - `continueOnError` boolean
      - `nameOverride` string
      - `overrides` FlowActionOverrides, nullable
        - `params` object

## Response `201`

Flow created

- object
  - `data` Flow, required
    - `id` string, uuid, required
    - `userId` string, uuid, required — Deprecated: use ownerId (tenancy) / createdBy (actor).
    - `ownerId` string, uuid, required
    - `createdBy` string, uuid, nullable, required
    - `name` string, required
    - `description` string, nullable, required
    - `triggerId` string, uuid, required
    - `enabled` boolean, required
    - `deviceIds` string[], required
    - `cooldownSeconds` integer, nullable, required
    - `cooldownScope` 'flow' | 'device', required
    - `notifyWebhookId` string, uuid, nullable, required
    - `notifyOnSuccess` boolean, required
    - `notifyOnFailure` boolean, required
    - `lastTriggeredAt` string, nullable, required
    - `status` 'healthy' | 'failing' | 'blocked', required
    - `consecutiveFailures` integer, required
    - `lastFailureCode` 'device_not_found' | 'permission_denied' | 'client_error' | 'transient' | 'logic' | 'invalid_config', nullable, required
    - `lastFailureAt` string, nullable, required
    - `blockedAt` string, nullable, required
    - `createdAt` string, nullable, required
    - `updatedAt` string, nullable, required

---

[API](https://skmtc.net/mobilerun/apis/workflows.md) · [All operations](https://skmtc.net/mobilerun/apis/workflows/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mobilerun/workflows/revisions/1bc499aa8f99/schema)
