> 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: "Run a component"
description: "Run a function, workflow, tool, or agent on the gateway and wait for its result."
method: "POST"
endpoint: "/v1/:type/:name/run"
order: 6
group: "Gateway: run components"
last_verified: 2026-10-08
---



`POST /v1/:type/:name/run`

Run a function, workflow, tool, or agent on the gateway and wait for its result.


  ## 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} />

  The request body is the component's input as a JSON object. An agent's input includes a `message` field.



> Requests go to the gateway at `https://gw.agnt5.com`. A request with no `X-DEPLOYMENT-ID` and a key that was not created for an environment returns `409` with `environment has no active deployment`.



  ## Request example


```bash
curl -X POST "https://gw.agnt5.com/v1/workflows/order_workflow/run" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: {service_key}" \
  -H "X-DEPLOYMENT-ID: {deployment_id}" \
  -d '{"order_id": "4512"}'
```

```javascript
fetch('https://gw.agnt5.com/v1/workflows/order_workflow/run', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json', 'X-API-KEY': serviceKey, 'X-DEPLOYMENT-ID': deploymentId },
  body: JSON.stringify({ order_id: '4512' })
})
```


  ```json {{ title: 'Response' }}
  {
    "run_id": "7f6e5d4c-...",
    "status": "completed",
    "output": { "status": "complete", "order_id": "4512" },
    "error": null,
    "duration_ms": 824
  }
  ```



