regulado.lead.capture-email ​
Capture an interested-buyer email from the /avise-me form; insert into pre_launch_emails; deduplicate on email
Capture an interested-buyer email submitted from the /avise-me form.
Inserts into pre_launch_emails table. Deduplicates on email. Returns is_duplicate=false for new leads, is_duplicate=true for previously captured emails.
Migration dependency: pre_launch_emails table must exist before this workflow can reach COMPLETED. The founder lands the migration separately.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-regulado |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
email | string | Yes | — | Buyer email address; must be valid format |
product_ref | string | Yes | — | Product identifier, e.g. 'posto.regulado.com.br' |
source | string | No | — | Traffic source, e.g. 'google-ads-pec-6x1' |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
lead_uuid | string | No | — | — |
inserted_at | string | No | — | — |
is_duplicate | boolean | No | — | — |
failure_reason | string | No | — | — |
email | string | No | — | — |
product_ref | string | No | — | — |
source | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
failed_at_state | string | No | — | — |
failed_layer | string | No | — | — |
failed_step | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | Accepted; about to write lead to DB |
completed | No | Yes | Yes | — | Lead captured or deduplicated |
failed | No | Yes | No | — | Validation or DB error |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "regulado.lead.capture-email",
"initial_data": {
"email": "value",
"product_ref": "value"
}
}