> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lavendly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create workflow

> Persist a new workflow. Supports Idempotency-Key.

### Body

<ParamField body="name" type="string" required>Display name.</ParamField>
<ParamField body="description" type="string">Optional human description.</ParamField>
<ParamField body="nodes" type="array">ReactFlow nodes. Defaults to empty.</ParamField>
<ParamField body="edges" type="array">ReactFlow edges.</ParamField>
<ParamField body="duration" type="number">Total duration in seconds.</ParamField>
<ParamField body="thumbnail_url" type="string">Cover-image URL.</ParamField>

### Response

The persisted workflow including its server-assigned `id` and `version: 1`.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.lavendly.ai/v1/workflows \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer $LAVENDLY_API_KEY' \
    -H 'Idempotency-Key: 2026-05-16-first-fox' \
    -d '{
      "name": "Bookshop fox",
      "nodes": [
        { "id": "vid1", "type": "videoGenerator",
          "data": { "prompt": "a sleepy fox in a bookshop",
                    "videoModel": "cinematic", "duration": 5 } }
      ],
      "edges": []
    }'
  ```
</RequestExample>

<Tip>
  Re-POSTing the same body with the same `Idempotency-Key` within 5 min
  returns the same `id` instead of creating a duplicate.
</Tip>
