Guides & reference
Documentation
How to enqueue jobs, run workers, survive failures, and watch it all live — over REST, gRPC, or one of the four official SDKs.
The call that feeds the queue
import { SpooledClient } from '@spooled/sdk';
const client = new SpooledClient({
apiKey: process.env.SPOOLED_API_KEY!,
});
const userId = 'usr_123';
// Create a job
const { id } = await client.jobs.create({
queueName: 'email-notifications',
payload: {
to: 'user@example.com',
subject: 'Welcome!',
template: 'welcome',
},
idempotencyKey: `welcome-${userId}`,
maxRetries: 5,
});
console.log(`Created job: ${id}`);Canonical documentation
This site carries curated guides. The always-current reference lives with the code:
FAQ
Before you dig in
How do I enqueue my first job?
POST to
/api/v1/jobs with a queue name and JSON payload, using an API key for authentication. The quickstart shows the same call in cURL, Node.js, Python, and Go, plus a minimal worker that claims and completes jobs. Should I use REST or gRPC?
Use REST for web apps and most integrations. Use gRPC when workers process thousands of jobs per second — its HTTP/2 bidirectional streaming avoids per-request overhead.
How do workers claim jobs?
Workers poll a claim endpoint (or hold a gRPC stream) with a queue name, worker ID, and batch size, then report each job as complete or failed. Unreported jobs return to the queue after a visibility timeout.
How do I handle a job that keeps failing?
Let retries exhaust — the job moves to the dead-letter queue with its payload and error history intact. From there you can inspect it, fix the underlying issue, and bulk-retry, or purge it.
Can Spooled receive webhooks directly?
Yes. Incoming webhook endpoints accept Spooled-formatted JSON and enqueue jobs directly. For provider-specific webhooks like Stripe or GitHub, run a small adapter that verifies signatures and forwards the event.