npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lastshotlabs/slingshot-orchestration-temporal

v0.0.3

Published

Temporal-backed orchestration adapter and worker supervisor for Slingshot

Readme


title: Human Guide description: Human-maintained guidance for @lastshotlabs/slingshot-orchestration-temporal

What This Package Is For

@lastshotlabs/slingshot-orchestration-temporal is the Temporal provider package for Slingshot orchestration. It keeps the task/workflow authoring surface portable while delegating durable execution, timers, retries, schedules, visibility, and worker coordination to Temporal.

When To Use It

  • Use it when orchestration runs must survive process restarts and execute across multiple machines.
  • Use it when a workflow needs Temporal-native scheduling, signals, or queryable history.
  • Prefer memory or SQLite for local-only development where you do not need external infrastructure.
  • Prefer BullMQ when Redis is already your queue backbone and you do not need Temporal semantics.

Minimum Setup

  • A Temporal service or Temporal Cloud namespace
  • @temporalio/client on the server side
  • @temporalio/worker on the worker side
  • @lastshotlabs/slingshot-orchestration for the portable task/workflow definitions
import { Client, Connection } from '@temporalio/client';
import { z } from 'zod';
import {
  defineTask,
  defineWorkflow,
  step,
  stepResult,
} from '@lastshotlabs/slingshot-orchestration';
import {
  createTemporalOrchestrationAdapter,
  createTemporalOrchestrationWorker,
} from '@lastshotlabs/slingshot-orchestration-temporal';

const sendWelcomeEmail = defineTask({
  name: 'send-welcome-email',
  input: z.object({ email: z.string().email() }),
  output: z.object({ ok: z.boolean(), email: z.string().email() }),
  async handler(input) {
    return { ok: true, email: input.email };
  },
});

const onboardUser = defineWorkflow({
  name: 'onboard-user',
  input: z.object({ email: z.string().email() }),
  output: z.object({ ok: z.boolean(), email: z.string().email() }),
  outputMapper(results) {
    return stepResult(results, 'send-email', sendWelcomeEmail)!;
  },
  steps: [step('send-email', sendWelcomeEmail)],
});

const connection = await Connection.connect({ address: 'localhost:7233' });
const client = new Client({ connection, namespace: 'default' });

const adapter = createTemporalOrchestrationAdapter({
  client,
  connection,
  namespace: 'default',
  workflowTaskQueue: 'slingshot-workflows',
  defaultActivityTaskQueue: 'email-activities',
  ownsConnection: false,
});

const worker = await createTemporalOrchestrationWorker({
  connection,
  namespace: 'default',
  workflowTaskQueue: 'slingshot-workflows',
  defaultActivityTaskQueue: 'email-activities',
  buildId: 'dev-build-1',
  definitionsModulePath: new URL('./definitions.ts', import.meta.url).pathname,
});

void worker.run();

What You Get

  • createTemporalOrchestrationAdapter() for server-side orchestration control
  • createTemporalOrchestrationWorker() for Node worker bootstrap
  • generated workflow-module support for handlers-directory and manifest worker bootstraps
  • deterministic run ID derivation and Temporal search-attribute helpers
  • adapter and worker validation schemas for plugin config

Enterprise fit

  • Choose Temporal when workflow state is a system of record, not just a job queue.
  • Choose Temporal when long-running quoting, underwriting, ordering, approval, or fulfillment flows need durable timers, signals, and queryable execution history.
  • Keep domain services outside the adapter. Temporal still runs the same portable task and workflow definitions from @lastshotlabs/slingshot-orchestration; your worker loads those definitions and task handlers call your real service layer.

Common Customization

  • Choose separate workflowTaskQueue and defaultActivityTaskQueue values when workflow execution and activity execution should scale independently.
  • Use namespace per environment or deployment boundary.
  • Use taskNames and workflowNames on the worker when a process should poll only part of the orchestration surface.
  • Set generatedWorkflowsDir when you want generated workflow bundles in a predictable location.
  • Attach an eventSink if workflow/task lifecycle events should be mirrored back into Slingshot.

Gotchas

  • Temporal workers must run on real Node.js. Bun is not supported for worker startup.
  • The adapter does not start workers for you. Server and worker lifecycle are intentionally separate.
  • If the adapter owns the Temporal connection, make sure shutdown responsibility is clear.
  • Manifest mode still needs task/workflow code in handler modules or definitions modules.
  • Search attributes and visibility depend on the Temporal cluster being configured correctly.

Key Files

  • packages/slingshot-orchestration-temporal/src/index.ts
  • packages/slingshot-orchestration-temporal/src/adapter.ts
  • packages/slingshot-orchestration-temporal/src/worker.ts
  • packages/slingshot-orchestration-temporal/src/workflowModuleGenerator.ts