LaufwerkLaufwerk
Learn Laufwerk

Human input and review

Turn a person’s decision into recorded workflow input, with basic questions or a custom form.

A human decision is a workflow step. Give the person a specific candidate, the supporting evidence and a clear choice. Their response becomes data your code uses.

Choose the smallest useful interaction

NeedAPIResult
Accept or declineHuman.confirmBoolean
Describe a requested changeHuman.textString
Choose the next routeHuman.selectSelected value
Review multiple fields or edit a draftHuman.requestSchema-validated response
Record a notice and continueHuman.notifyNo answer

notify records a notice in Laufwerk. It does not send email or a chat message.

An answer controls the next step

Call this helper inside a registered workflow after preparing a draft. The round argument supplies a stable identity for each review cycle.

review.ts
import { Effect } from "effect";
import { Human } from "@laufwerk/sdk";

export const reviewDraft = (round: number, draft: string) => Effect.gen(function* () {
  const decision = yield* Human.select({
    key: `review-${round}`, title: "How should this draft proceed?",
    description: draft,
    options: [
      { value: "accept", label: "Accept the draft" },
      { value: "revise", label: "Request changes" },
      { value: "decline", label: "Stop this draft" },
    ],
  });
  const feedback = decision === "revise"
    ? yield* Human.text({ key: `feedback-${round}`, title: "What should change?" })
    : "";
  return { decision, feedback };
});

An unanswered question suspends the workflow. The question and answer survive a restart; Studio displays stored state. Answering the same recorded request does not create another review round. Later rounds need distinct deterministic keys.

Give complex reviews their own interface

Stored candidate → your React view → typed response

                         server validation → workflow branch

A HumanView contract defines display data and the response schema. Your React component receives data, submit, submitting and disabled. This can express an edited draft, a decision and feedback in one response.

Follow the complete custom form example for all four files, dependencies and setup. Keep the shared contract browser-safe.

An approval needs an enforced boundary

A confirmation returning false succeeds as an interaction; your code decides what to do with the refusal. Gate the privileged action after the affirmative branch, and keep the same action out of the agent's independent capabilities. A model with a publishing token can bypass a later “publish?” question.

Native agent tool approvals are a separate interaction type. Use CLI approve for those; use respond for workflow Human requests.

Reference: Human methods and response shapes


← Branches, loops and parallel work · Next: Durability, waiting and recovery →

On this page