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

# Stream workflow events

> Server-sent events. Each event: is the kind, id: is event_id, and data: is a JSON WorkflowEvent…

### Path parameters

<ParamField path="workflow_id" type="string (string)" required />

### Response

`object`

<ResponseField name="event_id" type="integer" required />

<ResponseField name="kind" type="string" required>
  Event kind, e.g. workflow\_completed / workflow\_failed / stream\_error
</ResponseField>

<ResponseField name="ts" type="string" required />

<ResponseField name="activity" type="string" />

<ResponseField name="attempt" type="integer" />

<ResponseField name="signal" type="string" />

<ResponseField name="preview" type="string" />

<ResponseField name="error" type="string" />

### Status codes

| Code  | Meaning                                                                                                                                                                                                                      |
| ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `200` | Server-sent events. Each `event:` is the `kind`, `id:` is `event_id`, and `data:` is a JSON `WorkflowEvent`; a `stream_error` event carries `&#123; 'kind': 'stream_error', 'error': '...' &#125;`. Honours `Last-Event-ID`. |
| `400` | Validation error                                                                                                                                                                                                             |
| `401` | Unauthorized                                                                                                                                                                                                                 |
| `404` | Not found                                                                                                                                                                                                                    |
| `429` | Rate limited                                                                                                                                                                                                                 |
| `500` | Internal error                                                                                                                                                                                                               |

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.workstream.stateset.com/v1/workflows/{workflow_id}/events' \
    --header "x-api-key: $STATESET_TEMPORAL_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "event_id": 1001,
    "kind": "standard",
    "ts": "string",
    "activity": "string",
    "attempt": 1,
    "signal": "string",
    "preview": "string",
    "error": "string"
  }
  ```
</ResponseExample>
