npm.io
4.0.0 • Published yesterday

@temporal-contract/contract

Licence
MIT
Version
4.0.0
Deps
2
Size
116 kB
Vulns
0
Weekly
8.3K
Stars
9

@temporal-contract/contract

Contract builder and type definitions for Temporal workflows and activities

npm version

Installation

pnpm add @temporal-contract/contract zod

Quick Example

import { defineContract } from "@temporal-contract/contract";
import { z } from "zod";

export const myContract = defineContract({
  taskQueue: "orders",
  workflows: {
    processOrder: {
      input: z.object({ orderId: z.string() }),
      output: z.object({ success: z.boolean() }),
      activities: {
        /* ... */
      },
    },
  },
});

Documentation

Read the full documentation →

License

MIT

Keywords