# promoteWorkflowDraft

Ship it: promote the workflow's current DRAFT to ACTIVE (live). MIGRATE (default) moves in-flight runs to the new version: on a kept step they continue with the new copy, on a removed step they finish, held by a pause they wake. PAUSE keeps them on the old version, whose copy they send if resumed. Fails without a valid draft (see getWorkflow.draftValidation).

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "promoteWorkflowDraft", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `workflowGroupId`: `ID!` (required)
- `inFlightRunsStrategy`: `InFlightRunsStrategy` (default `MIGRATE`, one of `LET_FINISH`, `PAUSE`, `MIGRATE`). How promote treats the superseded version's in-flight runs. PAUSE holds them there; MIGRATE (and LET_FINISH, run as MIGRATE) moves them to the new version.

## Response (data, an example)

```json
{
  "workflowAutomationsMutation": {
    "promoteWorkflowGroupDraftToLive": {
      "id": "<ID>",
      "name": "…",
      "status": "DRAFT",
      "currentVersion": {
        "id": "<ID>",
        "name": "…",
        "status": "DRAFT"
      }
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "promoteWorkflowDraft",
    "variables": {
      "workflowGroupId": "<workflowGroupId>"
    }
  }'
```
