Skip to content

Latest commit

 

History

History
92 lines (64 loc) · 5.91 KB

File metadata and controls

92 lines (64 loc) · 5.91 KB
section cre
title Before You Build
date Last Modified
pageId getting-started-before-you-build
sdkLang go
metadata
description datePublished lastModified
Essential tips before building your own CRE workflows: working with time, randomness, and next steps for production deployment.
2026-02-04
2026-02-04

import { Aside } from "@components"

You've completed the Getting Started guide and built a workflow that fetches offchain data, reads from a smart contract, performs calculations, and writes results onchain. You're ready to build your own workflows.

Before you do, take two minutes to understand how CRE differs from typical development. These tips will save you debugging time.

Working with time

If your workflow uses timestamps (e.g., for API authentication or time-based queries), use runtime.Now() instead of time.Now(). This ensures all nodes in the DON use the same timestamp and can reach consensus.

{/* prettier-ignore */}

See [Using Time in Workflows](/cre/guides/workflow/time-in-workflows) for details on DON time and best practices.

Working with randomness

If your workflow needs random values (e.g., selecting a winner or generating nonces), use runtime.Rand() instead of Go's rand package. This ensures all nodes generate the same random sequence and can reach consensus.

{/* prettier-ignore */}

See [Using Randomness in Workflows](/cre/guides/workflow/using-randomness) for usage examples and best practices.

{/* prettier-ignore */}

Time and randomness are the most common cases. For a complete guide to non-determinism (map iteration, JSON serialization, channel selection, and more), see [Avoiding Non-Determinism in Workflows](/cre/concepts/non-determinism).

What's next?

Here are resources to help you go from simulation to production.

Learn from examples

Deploy to production

{/* prettier-ignore */}

Deploying requires approval. Run `cre account access` to submit a request. See [Requesting Deploy Access](/cre/account/deploy-access). While you wait, continue building and simulating workflows.
  1. Link a Wallet Key — Required for the default onchain Workflow Registry. Not needed when using deployment-registry: "private".
  2. Deploy Your Workflow — Push your workflow live. Optionally set deployment-registry: "private" in workflow.yaml to use the Chainlink-hosted private registry (no linked key or gas required for registry operations).
  3. Monitor Your Workflow — Watch it execute and debug issues

Explore different triggers

You used a Cron trigger. Most production workflows react to events:

Add secrets

Real workflows need API keys and sensitive data:

Build your own consumer contract

Reference

Dive deeper into concepts from this guide:

Topic Resources
Workflow structure Core SDK, Triggers Overview
HTTP & offchain data API Interactions, Consensus & Aggregation
EVM interactions EVM Client Overview, Onchain Read, Onchain Write
Configuration Project Configuration, Secrets Guide
All capabilities Capabilities Overview