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.
Steps
The sequence below applies to both Workflow and Chatflow apps. Only the entry endpoint in Step 1 differs between the two.Start the app in streaming mode
-
Call Run Workflow (Workflow apps) or Send Chat Message (Chatflow apps), passing your end user’s
useridentifier. -
Watch the SSE stream for the
human_input_requiredevent and capture itsform_token. Ifform_tokenisnull, the form uses Email delivery and can’t be driven via the API (see Delivery Method Requirement). Thehuman_input_requiredevent also carries the run’sworkflow_run_id; keep it in case you need to resume listening in Step 5.
Get the form definition
Call Get Human Input Form with
form_token. The response includes the rendered Markdown, input field definitions, available actions, pre-filled default values, and an expiration_time after which the form can no longer be submitted. Render the form for the recipient.If the form expires before it is submitted, the paused run follows the node’s configured timeout behavior; a resumed stream then carries human_input_form_timeout rather than human_input_form_filled.(File inputs only) Upload local files
If the recipient attaches a local file to a
file or file-list input, upload it first with Upload File. It returns an id you reference as upload_file_id in the submit payload. Use one consistent user across the run, upload, and submit calls (see End User Identity for details).A remote file needs no upload step: attach it inline in the submit as a {transfer_method: remote_url, url} mapping.Submit the response
Call Submit Human Input Form with the recipient’s input values, the selected
action, and your user. The action must be one of the actions from the form definition in Step 2.File inputs accept either a {transfer_method: local_file, upload_file_id} mapping (from Step 3) or an inline {transfer_method: remote_url, url} mapping. See Upload First vs. Inline Remote URL for the trade-off.A successful submit is final: it closes the form and resumes the run along the matching action branch, so the same form_token can’t be submitted again.A rejected submit (an invalid action, a missing required input, or a failed remote-file fetch) leaves the form unchanged—fix the inputs and resubmit with the same form_token.Resume listening to the workflow
If the original SSE stream closed, reopen it via Stream Workflow Events with the
workflow_run_id from Step 1 and the same user that started the run—a different user gets a 404.The resumed stream includes human_input_form_filled confirming the submission (or human_input_form_timeout if the form expired), then the remaining node events through to completion, like a run that never paused.Add include_state_snapshot=true to first replay the status of nodes that already executed. If the workflow has more than one Human Input node in sequence, the stream closes at each pause by default; pass continue_on_pause=true to keep one stream open across all of them.Upload First vs. Inline Remote URL
Both patterns work for file inputs:-
Pre-upload, then reference
upload_file_id(recommended) Upload File enforces the file size limits 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.
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 / reject actions.
-
Call Get Human Input Form to get the form definition:
Returns the form definition:
-
For each local file, call Upload File:
Returns
{"id": "1a77f0df-...", ...}. -
Call Submit Human Input Form with the recipient’s input and selected action:
Returns
{}. The workflow resumes along theapprovebranch. - Reconnect to the run’s stream with Stream Workflow Events to follow it through to completion, as in Step 5 of the sequence above.