> For the complete documentation index, see [llms.txt](/llms.txt).
> A full single-fetch corpus is available at [llms-full.txt](/llms-full.txt).
---
title: "Start and stream a run"
description: "Start a component run and receive its events as Server-Sent Events while it executes."
method: "POST"
endpoint: "/v1/:type/:name/stream"
order: 8
group: "Gateway: run components"
last_verified: 2026-10-08
---



`POST /v1/:type/:name/stream`

Start a component run and receive its events as Server-Sent Events while it executes.


  ## Parameters

  - `X-API-KEY` _header_ **required** — A service key with the `run` scope.
  - `X-DEPLOYMENT-ID` _header_ — The deployment to use. Leave it out when the key was created for one environment; the live deployment of that environment is used.
  - `type` _string_ **required** — `functions`, `workflows`, `tools`, or `agents`.
  <ApiAttribute name="name" type="string" description="The component's registered name. `agnt5 components --env <environment>` lists them." required={true} />
  - `Accept` _header_ **required** — `text/event-stream`.



> Durable events carry an `id:` offset. Live-only events such as logs carry none. The terminal event carries `id: done`, and the stream ends.



  ## Request example


```bash
curl -N -X POST "https://gw.agnt5.com/v1/workflows/order_workflow/stream" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -H "X-API-KEY: {service_key}" \
  -d '{"order_id": "4512"}'
```

```javascript
const res = await fetch('https://gw.agnt5.com/v1/workflows/order_workflow/stream', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json', 'Accept': 'text/event-stream', 'X-API-KEY': serviceKey },
  body: JSON.stringify({ order_id: '4512' })
})
```


  ```text {{ title: 'Response (Server-Sent Events)' }}
  event: run.started
  data: {"event_type":"run.started","data":{...}}
  id: 1970324840974003

  event: log.debug
  data: {"event_type":"log.debug","data":{...}}

  event: run.completed
  data: {"event_type":"run.completed","data":{...}}
  id: done
  ```



