Function humanNode

  • Creates a human-in-the-loop node that suspends execution until a human (or automated surrogate) provides a decision.

    Parameters

    • config: {
          prompt: string;
          timeout?: number;
          autoAccept?: boolean;
          autoReject?: string | boolean;
          judge?: {
              model?: string;
              provider?: string;
              criteria?: string;
              confidenceThreshold?: number;
          };
          onTimeout?: "error" | "reject" | "accept";
          guardrailOverride?: boolean;
      }
      • prompt: string

        Message displayed to the human operator.

      • Optional timeout?: number

        Maximum wall-clock milliseconds before the node is aborted or handled by onTimeout.

      • Optional autoAccept?: boolean

        Auto-accept without human input. Useful for testing/dev.

      • Optional autoReject?: string | boolean

        Auto-reject without human input.

      • Optional judge?: {
            model?: string;
            provider?: string;
            criteria?: string;
            confidenceThreshold?: number;
        }

        Delegate to LLM judge instead of human.

        • Optional model?: string
        • Optional provider?: string
        • Optional criteria?: string
        • Optional confidenceThreshold?: number
      • Optional onTimeout?: "error" | "reject" | "accept"

        What to do when timeout expires.

        Default

        'error'
        
      • Optional guardrailOverride?: boolean

        Run guardrails AFTER approval to catch destructive actions.

        Even when the node auto-accepts or is approved by an LLM judge, guardrails can still veto the decision as a safety net. When a guardrail blocks, the node returns approved: false with the guardrail's reason.

        Set to false to disable the guardrail safety net for this node.

        Default

        true
        
    • Optional policies: NodePolicies

      Optional per-node policy overrides.

    Returns GraphNode