> For the complete documentation index, see [llms.txt](https://polkadot.novabloq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://polkadot.novabloq.com/element-polkadot-api/actions/subscribe-to-new-blocks.md).

# Subscribe to new Blocks

Just like subscribing to balance changes, this will trigger an event every time a new block is mined, and publish a state with the block number.

## Setup

This action doesn't have any fields, just run it after the api was initialised.

### Action - Unsubscribe from new Block event

After subscribing you can of course unsubscribe by running this action and receiving events about new blocks.

### Event - New Block

This is the event that will be triggered every time a new block is mined.

### State - Last Block Nr

In this state you will find the number of the latest block.

## Demo

Find a demo on the [polkadot api](https://bubble.io/page?type=page\&name=polkadot_api\&id=polkadotjs\&test_plugin=1639402639641x977692461648052200_current\&tab=tabs-1) page. See the workflow folder **Subscribe blocks**

![](/files/C0Y9GViZRveVoRsz6hWG)
