## Create a task execution record

### cURL

```bash
curl --request POST \
  --url https://flows.super.ai/api/task-executions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "flow_execution_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "<string>",
  "task_execution_idx": 1,
  "task_name": "<string>",
  "error": "<unknown>",
  "input": "<unknown>",
  "output": "<unknown>"
}
'```

### Example

```json
{
  "flow_execution_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "<string>",
  "task_execution_idx": 1,
  "task_name": "<string>",
  "created_at": "2025-01-23T10:30:00Z",
  "error": {
    "message": "Connection timeout after 30 seconds",
    "traceback": "Traceback (most recent call last):\n ...",
    "type": "ConnectionError"
  },
  "input": "<unknown>",
  "modified_by": "system",
  "output": {
    "email_id": "msg_123",
    "sent_at": "2025-01-23T10:30:00Z"
  },
  "updated_at": "2025-01-23T10:35:00Z"
}
```

### Authorizations

- **X-API-Key**: string
  - Required in the header as: `X-API-Key YOUR_API_KEY`

- **Authorization**: string
  - Required in the header as: `Bearer YOUR_ACCESS_TOKEN`

### Body

- **flow_execution_id**: string<uuid> (required)
  - Example: `"123e4567-e89b-12d3-a456-426614174000"`

- **status**: string (required)
  - Valid values: 'queued', 'running', 'completed', 'failed', 'cancelled'.
  - Examples: `"running"`, `"completed"`, `"failed"`

- **task_execution_idx**: integer (required)
  - Examples: `0`, `1`, `2`

- **task_name**: string (required)
  - Examples: `"send_email"`, `"process_data"`, `"validate_input"`

- **error**: any (only set when status is 'failed')

- **input**: any (optional)

- **output**: any (optional)

### Response

- **201 Created**: Task execution created successfully.
