# Global Methods

## <mark style="color:orange;">`set_payload(payload=String, params=Hash)`</mark>

Creates a [payload with parameters](/contexts/blocks/postback.md#reading-params).

### Usage

```ruby
set_payload "products/show", {product_id: 5, category: "Clothes"}
```

This payload with its parameters will be received by a `postback` action block in the products context. Read about [postback block](/contexts/blocks/postback.md#postback-params).

{% hint style="success" %}
The payload in Telegram is called [`callback_data`](https://core.telegram.org/bots/api#inlinekeyboardbutton) and it only supports 64 characters. In Kogno we managed to increase that limit to much more, so you should not worry about that limit anymore.
{% endhint %}

## <mark style="color:orange;">`html_template(route=String, params=Hash)`</mark>

Render a template with `.rhtml` extension from the `bot/templates/context_name/` directory.

### Usage

```ruby
html_template "main/demo1", { title: "This is the title" }
```

The template `"main/demo1"` will be located in `bot/templates/main/demo1.rhtml`.

```ruby
<%= title %>
<% 7.times do %>
  <b>Hello</b> <i>World</i>
<% end %>
```


---

# 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.kogno.io/global-methods.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.
