User Forms

Documentation for User Forms

Base path: /api/v1/user-forms

User forms are human-in-the-loop approval/review forms generated by workflow steps that require human review before proceeding. When a workflow step is configured as a human input step, it pauses execution and creates a form for review.


Endpoints Overview

MethodPathAuthDescription
GET/api/v1/user-formsJWTList forms for the authenticated user
GET/api/v1/user-forms/:formIdNoneGet form HTML content
POST/api/v1/user-forms/:activityRunId/:statusNoneSubmit a form approval/rejection

GET /api/v1/user-forms

Lists all user forms for workflows owned by the authenticated user.

Authentication

Requires JWT (authMiddleware + activeOrgPreferenceMiddleware).

Query Parameters

ParameterTypeDefaultDescription
pagenumber1Page number (min: 1)
limitnumber20Items per page (min: 1, max: 100)
searchstring–Search by workflow name (case-insensitive)
sortBystring"createdAt"Sort field: createdAt, updatedAt, workflowName, status
sortOrderstring"desc"Sort direction: asc, desc
statusstring–Filter by status: pending, approved, rejected

Response 200 OK

json

Form object fields:

FieldTypeDescription
idstring (UUID)Form ID
workflowIdstring (UUID)Associated workflow ID
workflowNamestringWorkflow name
workflowDescriptionstring | nullWorkflow description
workflowRunIdstring (UUID)The workflow run that created this form
activityRunIdstring (UUID)The activity (step) run that paused for this form
workflowStepNamestringName of the step requiring approval
workflowStepDescriptionstring | nullStep description
status"pending" | "approved" | "rejected"Review status
reviewedBystring | nullUser ID of reviewer (if reviewed)
reviewedAtstring (ISO 8601) | nullWhen the form was reviewed
createdAtstring (ISO 8601)When the form was created
updatedAtstring (ISO 8601)Last update time

GET /api/v1/user-forms/:formId

Returns the HTML content of a user form. This endpoint is public (no authentication required) β€” forms are accessed via a link sent to the reviewer.

Authentication

None required (publicly accessible via a unique form ID).

Path Parameters

ParameterTypeDescription
formIdstring (UUID)Form ID

Response 200 OK

json
FieldTypeDescription
htmlstringThe form's HTML definition, ready to be rendered in a browser

Usage Pattern

Forms are typically rendered in an iframe or opened in a new browser tab. The HTML includes a form that submits to the approve/reject endpoint.


POST /api/v1/user-forms/:activityRunId/:status

Submits a form approval or rejection. This resumes the paused workflow with the form data. This endpoint is public β€” it is submitted by the reviewer clicking approve/reject in the form.

Authentication

None required (the form link serves as authorization).

Path Parameters

ParameterTypeDescription
activityRunIdstring (UUID)Activity run ID associated with the form
status"approve" | "reject"The approval decision

Request Body (multipart/form-data)

Any form field values filled in by the reviewer. File fields are automatically uploaded to object storage, and a presigned URL replaces the file in the submitted data.

Response

Returns an HTML page confirming submission:

  • If successful: success page with "Form Submitted Successfully"
  • If already submitted: info page with "Form Already Submitted"

The HTTP status is 200 OK in both cases (the response is HTML, suitable for browser navigation).

Errors

StatusReason
404 Not FoundActivity run or workflow run not found
500 Internal Server ErrorWorkflow has no Temporal workflow association

Workflow Integration Notes

User forms appear during workflow execution when:

  1. A workflow step has is_human_input_step: true in its definition
  2. The executor pauses the Temporal workflow and creates a form record
  3. The form link is communicated to the reviewer (typically via email or notification)
  4. The reviewer submits the form, which sends a Temporal signal to resume execution

The form data (including reviewer inputs) is passed back to the workflow step as the step's input for subsequent processing.

api-docs/user-forms