# Webhook Run Info

By default, webhooks do not reveal any information to the request originator beyond whether Valohai has accepted the webhook.

This behaviour can be customized by returning the Trigger's **Run ID** to the requester.

## Adding the Run ID

You can return either plain text or JSON from the webhook. Run ID can be added to either type of response using the `{run_id}` placeholder.

For Response Text, add the placeholder anywhere in your text:

```
Created run {run_id}
```

<figure><img src="/files/6trdXlyw0Tz7Fr5pcV9O" alt=""><figcaption></figcaption></figure>

For Response JSON, the placeholder must be inside a string within the JSON document. It can also be within nested objects:

```json
{
  "status": "success",
  "run_id": "{run_id}",
  "message": "Pipeline launched"
}
```

<figure><img src="/files/O8NQZJGKwsNlkx9lZItM" alt=""><figcaption></figcaption></figure>

## Using the Run ID

The run info endpoint is a sub-endpoint of the webhook launch endpoint, located at `https://app.valohai.com/api/v0/launch/<trigger_ID>/run/`. Accessing it requires passing the same request authentication conditions as the original launch request.

With a `GET` request, add `?run_id=<run_id>` as the query parameter. If your authentication conditions require additional query parameters, add them as well.

With a `POST` request, include a `run_id` value in the request body. The request body can be either form encoded or JSON. When using JSON remember to add a `Content-Type: application/json` header, and supply `run_id` in the top level object. Using `POST` is required to comply with HMAC authentication conditions that validate the request body.

The run info endpoint returns information about the trigger run's status and action results.

The run may be `pending`:

```json
{
  "status": "pending",
  "result": []
}
```

This indicates the trigger run is being processed by Valohai, and you should request run info again later.

When the run has completed, action results are also included:

```json
{
  "status": "completed",
  "result": [
    {
      "action": "run_execution",
      "execution_step": "Batch feature extraction",
      "execution_id": "<the created execution ID>"
    }
  ]
}
```

Actions that run pipelines, copy pipelines and run executions will declare the objects they create using this API.

Error details during trigger run are not reported using this API, but the status will be `error` (all actions failed) or `complete_with_error` (some actions were successful). You can find error details in the trigger log.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.valohai.com/automation-overview/triggers/webhooks/webhook-run-info.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
