Skip to content

Repository files navigation

@lucid-softworks/workflow-task

Typed tasks with schema-validated inputs and outputs.

import { stringSchema } from "@lucid-softworks/schema-primitives";
import { defineTask } from "@lucid-softworks/workflow-task";

const fetchUser = defineTask({
  id: "fetch-user",
  input: stringSchema(),
  output: stringSchema(),
  run: async (id, context) => {
    if (context.signal.aborted) throw new Error("Cancelled");
    return `User ${id}`;
  },
});

Releases

Packages

Contributors

Languages