Forms - Data Capture
What are Forms
Section titled “What are Forms”The form system allows creating data capture forms that can trigger workflows or be presented within a workflow execution. It is composed of two main modules:
- FormTrigger: Starts a workflow from a form submission.
- FormRender: Generates and displays forms within a running workflow.
Form Trigger - Start Workflow from Form
Section titled “Form Trigger - Start Workflow from Form”This is a trigger that starts the workflow when a form is submitted. It works similarly to the webhook, but includes additional form metadata.
The received data includes:
{ "campo1": "valor", "_request": { "method": "POST", "timestamp": "...", "source": "form" }, "_form": { "form_id": "1", "form_name": "Registro", "form_fields": [...] }}Supports OTP (One-Time Password) flow for user identity verification before processing the submission.
Form Render - Display Forms in the Flow
Section titled “Form Render - Display Forms in the Flow”Generates a form pre-populated with workflow data. It has three output modes:
- url: Returns a URL to access the form (default mode).
- html: Returns embeddable HTML directly in a page or email.
- redirect: Redirects the user to the form automatically.
Uses temporary sessions with a 24-hour duration to pre-fill form fields. The form_prefill_sessions table stores this temporary data until expiration.
Field Mapping (field_mapping)
Section titled “Field Mapping (field_mapping)”Allows pre-filling form fields with data from the workflow. Dynamic variables are used to reference values from previous nodes or workflow variables:
{ "email": "{{@Webhook.email}}", "nombre": "{{@HTTP_Request.data.name}}", "empresa": "{{var.empresa_nombre}}"}This way, when the user accesses the form, the indicated fields already contain the corresponding values.
Form Render Configuration
Section titled “Form Render Configuration”| Parameter | Type | Description |
|---|---|---|
| form_id | text | ID of the form to render |
| field_mapping | json | Field mapping with dynamic variables |
| output_type | select | url, html, redirect |
| redirect_after_submit | boolean | Redirect after submission |
| custom_title | text | Custom title (supports variables) |
| custom_description | textarea | Custom description |
Forms Database
Section titled “Forms Database”The main tables involved are:
- forms:
id,name,description,form_json,settings,public_hash - form_prefill_sessions:
session_hash,form_id,prefill_data,expires_at(24h) - form_submissions: Stores the responses submitted by users
Example: Client Registration Flow
Section titled “Example: Client Registration Flow”Webhook (receives partial data from CRM) -> HTTP (query additional data) -> FormRender (pre-fill registration form) -> [User completes the form]
FormTrigger (receives completed form) -> DataStore (save client) -> SendMail (send confirmation) -> EndIn this flow, initial data is received from a CRM via webhook, enriched with an external HTTP query, and a pre-filled form is generated for the user to complete the missing information. Once the form is submitted, a second workflow stores the data and sends a confirmation email.
Example: Form with Approval
Section titled “Example: Form with Approval”FormTrigger (vacation request) -> SetVariable (save request) -> SendMail (notify manager) -> FormRender (approval form for manager) -> [Manager approves/rejects]
FormTrigger (manager's response) -> Decision (approved?) -> true: SendMail (notify approval) -> false: SendMail (notify rejection) -> EndIn this case, an employee submits a vacation request through a form. The system notifies the manager and presents them with an approval form. Based on the manager’s response, the employee is notified whether the request was approved or rejected.