CRE Workflows HubCRE Workflows Hub
  • Workflows
  • Chainlink repo
  • Sign in
CRE Workflows Hub
  • Workflows
  • Docs
  • Contribute workflow
  • Chainlink CRE Templates

A registry for Chainlink Runtime Environment workflows. List and share your CRE workflows without waiting for upstream approval.

Back

Created by Chainlink Labs

Indexer Block Trigger

Workflows for processing new blocks and transactions using block-triggered webhooks from Alchemy Notify.

View on GitHub
TypeScript
Go

Workflows for processing new blocks and transactions using block-triggered webhooks (from Alchemy Notify) and matching against watched addresses. These workflows demonstrate the block trigger pattern where the workflow reacts to incoming block data and extracts relevant transactions.

Directory Structure

  • block-trigger-go/ (Go): main.go, config.staging.json, config.production.json, workflow.yaml, README.md
  • block-trigger-ts/ (TypeScript): main.ts, package.json, config.staging.json, workflow.yaml, README.md

Overview

  • React to block events via HTTP webhook triggers (Alchemy Notify)
  • Match transactions to a list of watched addresses
  • Process and return JSON-formatted block and transaction data
  • Implement the same logic in both Go and TypeScript

Workflows extract: block number, hash, timestamp; all transactions; transactions where to address matches watched addresses.

Go: cd block-trigger-go, cre workflow simulate workflow --non-interactive --trigger-index 0 --http-payload test-block.json --target staging-settings

TypeScript: cd block-trigger-ts/workflow, bun install, cre workflow simulate workflow --non-interactive --trigger-index 0 --http-payload test-block.json --target staging-settings

Setup: CRE CLI, cre login; Go or Bun/Node for TS. Alchemy: sign up, create app, Webhooks > Real-time Notifications > Custom webhook for new blocks, set webhook URL.

Example use cases: monitoring high-value addresses, contract interaction tracking, block-level analytics.

Reference: CRE docs, Alchemy custom webhook docs.

Install the CRE CLI to use this template

You can use the command below or download the latest CLI release on GitHub.

curl -sSL https://cre.chain.link/install.sh | bash
Author
Chainlink Labs
LicenseMIT

Disclaimer

This template represents an educational example to use a Chainlink system, product, or service and is provided to demonstrate how to interact with Chainlink's systems, products, and services to integrate them into your own. This template is provided "AS IS" and "AS AVAILABLE" without warranties of any kind, it has not been audited, and it may be missing key checks or error handling to make the usage of the system, product or service more clear. Do not use this example in a production environment without completing your own audits and application of best practices. Neither Chainlink Labs, the Chainlink Foundation, nor Chainlink node operators are responsible for unintended outputs that are generated due to errors in code.