Skip to content

Examples: Human Approval Flow

Suspending workflow execution for human sign-off via Slack.

ts
import { app } from "../runtime";

export const humanApproval = app.workflow("human-approval")
  .capability("notify-slack", {
    idempotencyKey: ({ execution }) => `slack:${execution.id}`,
    handler: async () => {
      await slack.postMessage("Approval requested");
      return { notified: true };
    },
  })
  .wait("wait-approval", { timeout: "48h" });

Invariant Durable Execution Engine.