brain/wiki/flows-execution/human-input.md
Human Input exposes public endpoints that let external users interact with flows via two modes: Forms (structured input fields) and Chat (conversational UI). Both are backed by flows whose trigger is the @activepieces/piece-forms piece. The backend endpoints are read-only and public — they return UI metadata (title, input schema, branding); the actual submission goes through the webhook endpoint.
human-input.service.ts — resolves flow, validates trigger type, builds response.GET /v1/human-input/form/:flowId and GET /v1/human-input/chat/:flowId (both securityAccess.public()).form_submission, file_submission, chat_submission./forms/<flowId> and chat at /chat/<flowId>.getFormByFlowIdOrThrow: loads flow → if no published version and useDraft false, returns null (404) → asserts trigger is forms-piece form_submission/file_submission → resolves exact piece version. file_submission returns a hardcoded single-file schema (SIMPLE_FILE_PROPS); form_submission returns trigger.settings.input.getChatUIByFlowIdOrThrow: asserts chat_submission trigger → fetches platform logo + name → returns ChatUIResponse with branding embedded (supports white-labeled chat).text, text_area, toggle, file.waitForResponse: when true, the flow run pauses after triggering and the frontend waits for a value to display back to the submitter.useDraft=true is passed — protects unpublished forms from accidental exposure.Fully available in CE/EE/Cloud — no plan flag required.
Entry point: humanInputService, defined in the human-input service and called by both the form and chat controllers.
packages/server/api/src/app/flows/flow/human-input/ — the whole backend slice: both controllers, the service, and the module that registers thempackages/core/execution/src/lib/flows/form.ts — shared zod contracts: FormInputType, FormProps, FormResponse, ChatUIProps, ChatUIResponse, USE_DRAFT_QUERY_PARAM_NAMEpackages/web/src/features/forms/ — form rendering component, API client, and query hookspackages/web/src/features/chat/ — chat UI components (bubble, input, message list, intro)packages/web/src/app/routes/forms/ — public form pagepackages/web/src/app/routes/chat/ — public chat page, the reusable chat shell, and the in-builder Drawer wrapper for testing chat_submission flowspackages/web/src/app/builder/state/chat-state.ts — builder-side chat state paired with the DrawerPaths verified 2026-07-17. An earlier version pointed at packages/core/shared/src/lib/automation/flows/form.ts; it moved to packages/core/execution/src/lib/flows/form.ts.