# rewriteWorkflowDraftTextStep

The publish dialog's "Rewrite for me": reword one DRAFT text step to lower its carrier-filter risk, saved on the draft. Pass a getWorkflow.draftValidation.carrierRisk row's nodeId, and its body as expectedBody; only for a medium or high `band`. A row with a templateId is the template's copy: reword it with updateContentTemplate instead (here it is refused). status REWRITTEN (body saved), else NO_BETTER_REWRITE or STEP_CHANGED (it no longer carries expectedBody), the step unchanged. Never publishes.

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

## Variables

- `workflowGroupId`: `ID!` (required)
- `nodeId`: `ID!` (required)
- `expectedBody`: `String!` (required)

## Response (data, an example)

```json
{
  "workflowAutomationsMutation": {
    "rewriteWorkflowDraftTextStep": {
      "status": "REWRITTEN",
      "body": "…",
      "scoreBefore": 0,
      "scoreAfter": 0
    }
  }
}
```

## 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": "rewriteWorkflowDraftTextStep",
    "variables": {
      "workflowGroupId": "<workflowGroupId>",
      "nodeId": "<nodeId>",
      "expectedBody": "<String>"
    }
  }'
```
