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

@ -4,6 +4,7 @@ import type { FlowType } from '@/types/common'
import type {
ConversationVariableResponse,
FetchWorkflowDraftResponse,
HumanInputFormData,
NodesDefaultConfigsResponse,
VarInInspect,
} from '@/types/workflow'
@ -94,3 +95,30 @@ export const fetchNodeInspectVars = async (flowType: FlowType, flowId: string, n
const { items } = (await get(`${getFlowPrefix(flowType)}/${flowId}/workflows/draft/nodes/${nodeId}/variables`)) as { items: VarInInspect[] }
return items
}
export const submitHumanInputForm = (token: string, data: {
inputs: Record<string, string>
action: string
}) => {
return post(`/form/human_input/${token}`, { body: data })
}
export const fetchHumanInputNodeStepRunForm = (
url: string,
data: {
inputs: Record<string, string>
},
) => {
return post<HumanInputFormData>(`${url}/preview`, { body: data })
}
export const submitHumanInputNodeStepRunForm = (
url: string,
data: {
inputs: Record<string, string> | undefined
form_inputs: Record<string, string> | undefined
action: string
},
) => {
return post<CommonResponse>(`${url}/run`, { body: data })
}