# CRE Templates
Source: https://docs.chain.link/cre/templates
Last Updated: 2026-02-26


Templates are workflow examples you can copy and customize for your own projects. They are curated and maintained by Chainlink, offering patterns you can use as references or starting points for your own workflows.

> **CAUTION: Educational Example Disclaimer**
>
> This page includes educational examples 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 the
> code in 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.

## Building Blocks and Starter Templates

Templates are organized into two categories:

### 1. Building Blocks

[Building Blocks](https://github.com/smartcontractkit/cre-templates/tree/main/building-blocks) are small, focused examples that teach **one concept at a time**. Each Building Block is self-contained and demonstrates a specific CRE capability or pattern. They feature minimal code, clear configuration, and are runnable locally with `cre workflow simulate`.

**Available Building Blocks:**

1. **`kv-store`** (Key-Value Store with AWS S3)
   - Reads a value from an AWS S3 object, increments it, and writes it back
   - Demonstrates: SigV4-signed HTTP requests, CRE secrets (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`), and consensus read → single write flow
   - Use case: Learn offchain write patterns with secrets and consensus

2. **`read-data-feeds`** (Chainlink Data Feeds)
   - Reads `decimals()` and `latestAnswer()` from <a href="https://docs.chain.link/data-feeds" target="_blank" rel="noopener noreferrer">Chainlink Data Feeds</a> on a cron schedule
   - Demonstrates: Contract ABIs, Go bindings generation, RPC configuration, and onchain reads
   - Use case: Learn how to read onchain data via contract calls

**When to use Building Blocks:**

- You want to learn a specific feature quickly (e.g., secrets + HTTP signing, reading a data feed, cron triggers)
- You need a focused code snippet to copy into your project
- You're exploring a new capability before integrating it into a larger workflow

### 2. Starter Templates

[Starter Templates](https://github.com/smartcontractkit/cre-templates/tree/main/starter-templates) are complete, end-to-end workflows that combine multiple capabilities and mirror real-world use cases. These templates are more comprehensive than Building Blocks and include production-like configuration, optional precompiled smart contracts, and generated bindings. They can be adapted directly into your own projects.

**Available Starter Templates:**

1. **`custom-data-feed`** (Custom Data Feed)
   - Periodically fetches offchain data via HTTP and pushes updates onchain
   - Demonstrates: Cron scheduling, secrets management, contract bindings, and blockchain writes
   - Use case: Build data feeds that combine offchain APIs with onchain smart contracts

2. **`bring-your-own-data`** (BYOD - NAV & PoR)
   - End-to-end examples for publishing Net Asset Value (NAV) and Proof of Reserve (PoR) data onchain
   - Demonstrates: Complete workflow with demo contracts for publishing institutional data
   - Use case: Publish verified financial or reserve data to smart contracts

3. **`multi-chain-token-manager`** (Multi-Chain Token Manager)
   - Orchestrates token operations and state across multiple blockchain networks
   - Demonstrates: Multi-chain RPC configuration, bindings, and cross-chain coordination patterns
   - Use case: Manage token operations across different EVM chains from a single workflow

**When to use Starter Templates:**

- You want a runnable reference architecture that shows production-ready patterns
- You're starting a new project and need a solid foundation
- You want to see how multiple CRE capabilities integrate in a real workflow

### How to access templates

Run `cre templates list` to browse all available templates, or run `cre init` to start a new project and pick one interactively. The **Hello World** templates are built into the CLI and always available. All other templates are fetched dynamically from GitHub at runtime.

All templates are also available on GitHub at [github.com/smartcontractkit/cre-templates](https://github.com/smartcontractkit/cre-templates):

- Browse all Building Blocks and Starter Templates
- Clone or fork templates to customize them for your use case
- View individual READMEs for detailed usage instructions

> **TIP: Quick Start: Custom Data Feed via CLI**
>
> The **Custom Data Feed** starter template is also available through `cre init` for a guided, interactive setup
> experience. We provide a step-by-step guide: [Running a Demo Workflow](/cre/templates/running-demo-workflow).

> **NOTE: Using custom or private template repositories**
>
> You can add your own or third-party template repositories as additional sources for `cre init`. See [Template Sources](/cre/reference/cli/templates) for details.

## When to use what

Choose the right template based on where you are in your CRE journey:

| Your Situation                                                           | Recommended Action                                                               |
| ------------------------------------------------------------------------ | -------------------------------------------------------------------------------- |
| Just finished the [Getting Started guide](/cre/getting-started/overview) | Run the **Custom Data Feed** template to see a more complex, real-world example  |
| Want to learn offchain writes with secrets and consensus                 | Clone the **`kv-store`** Building Block (AWS S3 example)                         |
| Need to read Chainlink Data Feeds in your workflow                       | Clone the **`read-data-feeds`** Building Block (onchain reads with ABIs)         |
| Building a custom data feed for your protocol                            | Fork the **`custom-data-feed`** Starter Template and customize it                |
| Publishing NAV or PoR data onchain                                       | Fork the **`bring-your-own-data`** Starter Template (includes demo contracts)    |
| Managing tokens across multiple chains                                   | Fork the **`multi-chain-token-manager`** Starter Template (cross-chain patterns) |

## Next steps

Ready to explore templates?

- **[Run the Custom Data Feed Template](/cre/templates/running-demo-workflow)** - Walk through this template with our step-by-step guide (available in Go and TypeScript)

- **[Browse all templates on GitHub](https://github.com/smartcontractkit/cre-templates)** - Explore the full collection of Building Blocks and Starter Templates

> **NOTE: Contributing**
>
> The CRE Templates repository is open source under the MIT license. If you've built a useful workflow pattern and want
> to share it with the community, consider contributing.