> For the complete documentation index, see [llms.txt](https://docs.kogno.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kogno.io/contexts/blocks/nlp_entity-1.md).

# after\_all

### <mark style="color:orange;">`before_anything(&block)`</mark>

## **Platforms**

<table><thead><tr><th width="362.78343949044586">Platform</th><th data-type="checkbox">Supported</th></tr></thead><tbody><tr><td>Messenger</td><td>true</td></tr><tr><td>WhatsApp</td><td>true</td></tr><tr><td>Telegram</td><td>true</td></tr></tbody></table>

## Usage

```ruby
class MainContext < Conversation

  def actions

    intent :greeting do 
      @reply.text "Hello, how can I help you?"
    end
    
    after_all do
       logger.info "This block will be executed on every incoming message or event"
    end

  end

end
```

{% hint style="warning" %}

## Execution exception

It will not be executed if [`delegate_to()`](/contexts.md#delegate_to-route-string-args-hash) or [`halt()`](/contexts/blocks.md#halt) methods were called in a block executed previously.
{% endhint %}
