.agents/features/human-input.md
The Human Input feature exposes public-facing endpoints that allow external users to interact with flows via two interaction modes: Forms (structured input fields that trigger a flow and optionally wait for a response) and Chat (a conversational UI backed by a flow). Both modes use flows whose trigger is the @activepieces/piece-forms piece. The backend endpoints are read-only and fully public — they return metadata about the form or chat UI (title, input schema, platform branding) that the frontend uses to render the interaction. Flows must be published (or the useDraft flag must be set) for the endpoints to return data. The frontend renders the form at /forms/<flowId> and the chat at /chat/<flowId>.
packages/server/api/src/app/flows/flow/human-input/form-controller.ts — GET /form/:flowId endpointpackages/server/api/src/app/flows/flow/human-input/chat-controller.ts — GET /chat/:flowId endpointpackages/server/api/src/app/flows/flow/human-input/human-input.service.ts — resolves flow, validates trigger type, builds responsepackages/server/api/src/app/flows/flow/human-input/human-input.module.ts — registers both controllerspackages/shared/src/lib/automation/flows/form.ts — FormInputType, FormInput, FormProps, FormResponse, ChatUIProps, ChatUIResponse, USE_DRAFT_QUERY_PARAM_NAMEpackages/web/src/features/forms/components/ap-form.tsx — form rendering componentpackages/web/src/features/forms/api/ — frontend API client for form metadatapackages/web/src/features/forms/hooks/ — TanStack Query hookspackages/web/src/features/chat/ — chat UI components (bubble, input, message list, intro)packages/web/src/app/routes/forms/ — public-facing form pagepackages/web/src/app/routes/chat/ — public-facing chat page@activepieces/piece-forms): The Activepieces piece that provides three triggers: form_submission, file_submission, and chat_submission.waitForResponse controls whether the flow pauses to return a value to the form submitter.waitForResponse: true).botName for display.id (flowId), title (flow display name), props (FormProps with inputs and waitForResponse), projectId, and piece version.id, title, props (botName), projectId, platformLogoUrl, platformName.boolean) that, when true, loads the draft flow version instead of the published version. Used during flow testing in the builder.Routes registered under the human-input module prefix.
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /v1/human-input/form/:flowId | public | Get form metadata for a flow |
| GET | /v1/human-input/chat/:flowId | public | Get chat UI metadata for a flow |
Both accept query parameter: useDraft: boolean (optional, defaults to false).
humanInputService
getFormByFlowIdOrThrow(flowId, useDraft):
useDraft is false, returns null → throws ENTITY_NOT_FOUND.@activepieces/piece-forms with name form_submission or file_submission.pieceMetadataService.resolveExactVersion.file_submission, returns a hardcoded single-file-input schema (SIMPLE_FILE_PROPS).form_submission, returns trigger.settings.input as the props.getChatUIByFlowIdOrThrow(flowId, useDraft):
chat_submission from @activepieces/piece-forms.logoIconUrl and name for branding.ChatUIResponse with platform branding embedded.| Type | Description |
|---|---|
text | Single-line text input |
text_area | Multi-line textarea |
toggle | Boolean toggle/checkbox |
file | File upload |
securityAccess.public() — no authentication is required. Anyone with the flow ID can access the form/chat metadata.useDraft=true is passed — this protects unpublished forms from being accidentally exposed.