| section | cre | ||||||
|---|---|---|---|---|---|---|---|
| title | Before You Build | ||||||
| date | Last Modified | ||||||
| pageId | getting-started-before-you-build | ||||||
| sdkLang | go | ||||||
| metadata |
|
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.
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.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).Here are resources to help you go from simulation to production.
- Run the Custom Data Feed Demo — A starter template you can run locally and customize
- Browse all Templates — Building blocks for specific patterns (secrets, HTTP auth, streams) and starter templates
- AI-Powered Prediction Market — Full end-to-end demo integrating CRE with Gemini AI and Firebase
{/* 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.- Link a Wallet Key — Required for the default onchain Workflow Registry. Not needed when using
deployment-registry: "private". - Deploy Your Workflow — Push your workflow live. Optionally set
deployment-registry: "private"inworkflow.yamlto use the Chainlink-hosted private registry (no linked key or gas required for registry operations). - Monitor Your Workflow — Watch it execute and debug issues
You used a Cron trigger. Most production workflows react to events:
- HTTP Trigger — Trigger via API calls
- EVM Log Trigger — React to onchain events
Real workflows need API keys and sensitive data:
- Using Secrets in Simulation — Local development
- Using Secrets with Deployed Workflows — Store secrets in the Vault DON for production
- Managing Secrets with 1Password — Best practice: inject secrets at runtime
- Building Consumer Contracts — Create contracts that receive CRE data
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 |