Quick Start
Get started with Blok - A framework for building modular, testable, observable backends
Introduction
Blok (Blok) is a backend framework, designed to be fast, flexible, and composable into your Node.js applications.
Blok has different parts:
Blok Core
Handles most of the logic, including workflow execution, node management, context handling, and runtime observability.
Blok CLI
A powerful command line tool to create projects, manage nodes and workflows, build and deploy your applications.
Triggers
Multiple ways to invoke your workflows - HTTP, gRPC, and more to come (Cron, events, queues).
Blok SDK
SDKs to invoke your workflows from any system—even legacy applications.
Want to learn more?
Read our in-depth What is Blok introduction.
Terminology
Node: A self-contained unit of logic—reusable and testable.
Workflow: Defines how multiple nodes execute together with branching logic and context passing.
Context (CTX): A shared execution object that flows through your workflow carrying parameters, inputs/outputs, secrets, and metadata.
Trigger: How workflows are invoked—HTTP, gRPC, or custom triggers.
Some basic knowledge of Node.js and TypeScript would be useful for further customizations.
Automatic Installation
A minimum version of Node.js 22 required.
npx nanoctl@latest create projectIt will ask you for:
- Project name: Your project name
- Template: Choose from available templates
A new Blok app should be initialized. Now you can start hacking!
Enjoy!
Create your first node in the src/nodes directory.
// src/nodes/hello.node.ts
import { Node } from '@blokdigital/core';
export const helloNode = new Node({
name: 'hello',
async execute(ctx) {
return {
message: `Hello, ${ctx.input.name || 'World'}!`
};
}
});Run the app in development mode and see http://localhost:3000.
npm run devLearn More
New to Blok? Don't worry, we are here to help!
If you find anything confusing, please give your feedback on GitHub Discussions!
Writing Content
For authoring workflows and nodes, make sure to read:
Nodes
Learn about the smallest unit of logic in Blok
Workflows
Discover how to compose nodes into powerful workflows
Context
Understand how data flows through your application
Triggers
Learn how to invoke your workflows