Start here
Modes
SDK reference
Shared reference
DocsSDK ModeQuickstart
Install the SDK, register jobs, expose the execution endpoint, and create the first deployment. Your code stays in your service throughout.
Note
This guide covers SDK Mode — the path that's live today.
Setup flow
SDK → CLI → Deploy
Time to first run
About 4 minutes
Assumes
A service to host jobs
Overview
1 · SDK
Register jobs in code
Keep workflow intent versioned with the rest of your application.
2 · CLI
Generate a manifest
Convert your registered jobs into a deployable workflow definition.
3 · Weev
Run with visibility
Trigger, manage and inspect background work from one operational layer.
Before you begin
Note
Step 1
$ pnpm add @weev/sdk # the Weev runtime $ pnpm add express # only if your service uses Express
Step 2
predecessors so Weev can enforce execution order.import { weev } from "@weev/sdk";
// define a job inside a batch so Weev can build the workflow
weev.job(
{
name: "generateInvoices",
batch: "monthlyBillingRun",
description: "Generate invoices for the current billing cycle",
predecessors: ["loadActiveSubscriptions"]
},
async (ctx) => {
ctx.log("info", "Generating invoices");
return { ok: true };
}
);name
Stable job identifier inside the batch.
batch
Groups related jobs into one workflow.
predecessors
Declares upstream jobs that must finish first.
Step 3
import express from "express"; import { createWeevMiddleware } from "@weev/sdk/express"; // receives execution requests from Weev const app = express(); app.use(createWeevMiddleware()); app.listen(4100);
Note
Weev calls your app. Your app still executes the job.
Runtime behavior
jobRunId. If the platform redelivers the same run request to your /.weev/run endpoint, the SDK dedupes active and recently completed run IDs inside the running service process.Scope
Per process
The dedupe set lives in memory. A duplicate reaching the same Node process is accepted without invoking your handler again.
Limit
Multi-replica services
If replica A receives the first dispatch and replica B a retry, B has no record of A's in-memory run set and may execute the job again.
Future
Stronger coordination
A later version should use durable dispatch leases or attempt tokens so suppression works across replicas and restarts.
Caution
Treat handlers as idempotent in production
Step 4
Initialize the project
Creates local Weev configuration in your repository.
weev initAuthenticate
Connects your machine to your Weev workspace.
weev loginLink the codebase
Associates this repo with the correct organization, project and environment.
weev linkGenerate the manifest
Scans your codebase for registered jobs and builds the workflow definition.
weev generateCreate a deployment
Uploads the workflow to Weev so it can be triggered and monitored.
weev pushAfter setup
Versioned workflow definitions
Changes to orchestration are pushed intentionally instead of drifting in place.
Manual and recurring runs
Trigger runs directly or configure recurring execution after deployment.
Execution visibility
Inspect active work, failures and run state in one place.
Cleaner ownership
Developers own job behaviour while Weev handles orchestration discipline.