When a workflow reaches a Human Input node, it pauses and emits aDocumentation Index
Fetch the complete documentation index at: https://dify-6c0370d8-docs-hitl-2.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
human_input_required event in the streaming response. The event carries a form_token that your integration uses to drive the form lifecycle until the workflow resumes.
For per-endpoint reference, see the Human Input API.
Sequence
The sequence below applies to both Workflow and Chatflow apps. Only the entry endpoint in Step 1 and the resume endpoint in Step 6 differ between the two.Start the app in streaming mode
- Call Run Workflow (Workflow apps) or Send Chat Message (Chatflow apps).
-
Watch for the
human_input_requiredevent in the SSE stream and captureform_token,form_id, andtask_idfrom the payload. You’ll usetask_idin Step 6 if the stream closes before the workflow resumes.
Get the form definition
Call Get Human Input Form with
form_token. The response includes the rendered Markdown, input field definitions, available actions, and any pre-filled default values. Render the form for the recipient.(File inputs only) Issue an upload token
If the form has
file or file-list inputs, call Issue Upload Token for a short-lived upload_token. Reuse the token across multiple uploads on the same form.(File inputs only) Upload files
For each file the recipient attaches, call one of:
- Upload Local File for files from the recipient’s device (multipart).
- Upload Remote File for files at a public URL that you want the backend to fetch and validate before submission.
id you’ll reference as upload_file_id in the submit payload.Submit the response
Call Submit Human Input Form with the recipient’s input values and the selected action.File inputs accept either a
{transfer_method: local_file, upload_file_id} mapping (from Step 4) or an inline {transfer_method: remote_url, url} mapping. See Upload First vs. Inline Remote URL for the trade-off.On success, the workflow resumes along the matching action branch.Upload First vs. Inline Remote URL
Both submission patterns work for file inputs:-
Pre-upload, then reference
upload_file_id(recommended) The backend validates file size, type, and extension at upload time, so the recipient gets immediate feedback and can retry before committing the whole submission. -
Submit inline with
transfer_method: remote_urlThe backend fetches the file at submit time. Faster to integrate, but any size, type, or fetch failure rejects the entire submission, forcing the recipient to redo other fields.
Authentication
The form-facing endpoints, Get Human Input Form and Submit Human Input Form, are unauthenticated. Theform_token itself is the credential, and the endpoints are rate-limited per client IP.
The file-upload endpoints require the Bearer upload_token from Step 3.
Delivery Method Requirement
The Human Input API works only with forms delivered via the Human Input node’s WebApp method. Email-only delivery doesn’t expose aform_token.
Example: File-Attached Submission
This example uses a form with afeedback paragraph input, an attachments file-list input, and approve / revise actions.
-
Call Get Human Input Form to get the form definition:
-
Call Issue Upload Token to get an upload token:
Returns
{"upload_token": "hitl_upload_...", "expires_at": ...}. -
For each local file, call Upload Local File:
Returns
{"id": "1a77f0df-...", ...}. -
Call Submit Human Input Form with the recipient’s input and selected action:
Returns
{}. The workflow resumes along theapprovebranch.