> For the complete documentation index, see [llms.txt](https://docs.valohai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.valohai.com/automation-overview/triggers/webhooks/webhook-run-info.md).

# 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="https://4109720758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ff3mjTRQNkASbnMbJqzJ2%2Fuploads%2Fgit-blob-9e3b64b836e99977998382298c5b01d03e4516e9%2Fimage.png?alt=media" 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="https://4109720758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ff3mjTRQNkASbnMbJqzJ2%2Fuploads%2Fgit-blob-aa81dc09a13aebf1a489ef0b5cbdc424787b29aa%2Fimage.png?alt=media" 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
