feat: Human Input Node (#32060)

The frontend and backend implementation for the human input node.

Co-authored-by: twwu <twwu@dify.ai>
Co-authored-by: JzoNg <jzongcode@gmail.com>
Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
Co-authored-by: zhsama <torvalds@linux.do>
This commit is contained in:
QuantumGhost
2026-02-09 14:57:23 +08:00
committed by GitHub
parent 56e3a55023
commit a1fc280102
474 changed files with 32667 additions and 2050 deletions

View File

@@ -2,6 +2,7 @@ import type { RefObject } from 'react'
import type { Viewport } from 'reactflow'
import type { BeforeRunFormProps } from '@/app/components/workflow/nodes/_base/components/before-run-form'
import type { ErrorHandleTypeEnum } from '@/app/components/workflow/nodes/_base/components/error-handle/types'
import type { FormInputItem, UserAction } from '@/app/components/workflow/nodes/human-input/types'
import type { SpecialResultPanelProps } from '@/app/components/workflow/run/special-result-panel'
import type { BlockEnum, CommonNodeType, ConversationVariable, Edge, EnvironmentVariable, InputVar, Node, ValueSelector, Variable, VarType } from '@/app/components/workflow/types'
import type { RAGPipelineVariables } from '@/models/pipeline'
@@ -165,6 +166,20 @@ export type WorkflowStartedResponse = {
workflow_id: string
created_at: number
}
conversation_id?: string // only in chatflow
message_id?: string // only in chatflow
}
export type WorkflowPausedResponse = {
task_id: string
workflow_run_id: string
event: string
data: {
outputs: any // todo: remove any
paused_nodes: string[]
reasons: any[] // todo: remove any
workflow_run_id: string
}
}
export type WorkflowFinishedResponse = {
@@ -298,6 +313,54 @@ export type AgentLogResponse = {
data: AgentLogItemWithChildren
}
export type HumanInputFormData = {
form_id: string
node_id: string
node_title: string
form_content: string
inputs: FormInputItem[]
actions: UserAction[]
form_token: string
resolved_default_values: Record<string, string>
display_in_ui: boolean
expiration_time: number
}
export type HumanInputRequiredResponse = {
task_id: string
workflow_run_id: string
event: string
data: HumanInputFormData
}
export type HumanInputFilledFormData = {
node_id: string
node_title: string
rendered_content: string
action_id: string
action_text: string
}
export type HumanInputFormFilledResponse = {
task_id: string
workflow_run_id: string
event: string
data: HumanInputFilledFormData
}
export type HumanInputFormTimeoutData = {
node_id: string
node_title: string
expiration_time: number
}
export type HumanInputFormTimeoutResponse = {
task_id: string
workflow_run_id: string
event: string
data: HumanInputFormTimeoutData
}
export type WorkflowRunHistory = {
id: string
version: string