FlowiseAI/Flowise · error · Error

Invalid human input type. Expected 'proceed' or 'reject', bu

Error message

Invalid human input type. Expected 'proceed' or 'reject', but got '${humanInput.type}'

What it means

When the Agent node receives a humanInput (human-in-the-loop resume), it only accepts type 'proceed' or 'reject'. Any other type value aborts with this message before handleResumedToolCalls runs. The input is parsed from a JSON string or object stored in nodeData.inputs.humanInput.

Source

Thrown at packages/components/nodes/agentflow/Agent/Agent.ts:1118

             * Only the inserted temporary messages contain base64 — other messages are untouched.
             */
            await addImageArtifactsToMessages(messages, options)

            // Check if this is hummanInput for tool calls
            const _humanInput = nodeData.inputs?.humanInput
            const humanInput: IHumanInput = typeof _humanInput === 'string' ? JSON.parse(_humanInput) : _humanInput
            const humanInputAction = options.humanInputAction
            const iterationContext = options.iterationContext

            // Track execution time
            const startTime = Date.now()

            // Get initial response from LLM
            const sseStreamer: IServerSideEventStreamer | undefined = options.sseStreamer

            if (humanInput) {
                if (humanInput.type !== 'proceed' && humanInput.type !== 'reject') {
                    throw new Error(`Invalid human input type. Expected 'proceed' or 'reject', but got '${humanInput.type}'`)
                }
                const result = await this.handleResumedToolCalls({
                    humanInput,
                    humanInputAction,
                    messages,
                    toolsInstance,
                    sseStreamer,
                    chatId,
                    input,
                    options,
                    abortController,
                    llmWithoutToolsBind,
                    isStreamable,
                    isLastNode,
                    iterationContext,
                    isStructuredOutput
                })

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Send humanInput as { type: 'proceed' } to approve the pending tool call, or { type: 'reject' } to deny it.
  2. Update the frontend resume handler to emit exactly 'proceed' or 'reject'.
  3. Validate the payload against the IHumanInput schema before submitting.
  4. If extending actions, coordinate a code change here first — the values are hardcoded.

Example fix

// before
const humanInput = { type: 'approve', toolCallId: '...' }

// after
const humanInput = { type: 'proceed', toolCallId: '...' }
Defensive patterns

Strategy: validation

Validate before calling

const ALLOWED = new Set(['proceed', 'reject'])
function normalizeHumanInput(raw) {
  const hi = typeof raw === 'string' ? JSON.parse(raw) : raw
  if (!hi || !ALLOWED.has(hi.type)) {
    throw new Error(`humanInput.type must be one of ${[...ALLOWED].join(', ')}`)
  }
  return hi
}

Type guard

function isHumanInput(v) {
  return !!v && (v.type === 'proceed' || v.type === 'reject')
}

Try / catch

try { await agent.run(nodeData, input, options) }
catch (e) {
  if (/Invalid human input type/.test(e.message)) {
    // re-send a valid proceed/reject payload
  } else throw e
}

Prevention

When it happens

Trigger: Submitting a resume payload with humanInput.type set to 'yes', 'approve', 'continue', undefined, or any string other than the two allowed; malformed resume message from a custom UI; replaying a stale humanInput object whose schema changed between versions.

Common situations: Custom chat UI sending its own action verbs; API client guessing the resume action format; version mismatch where older flows used different type names; button label-to-action mapping bug in the frontend.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/84c1b1ca50fe6db0. Report an issue: GitHub.