Form (PbotForm)
PbotForm pauses workflow execution to collect structured input from an external party. Unlike PbotApproval (which collects a decision from an internal reviewer), PbotForm collects data from anyone ā customers, vendors, partners.
Basic Usage
{
"type": "PbotForm",
"properties": {
"expected_keys": ["shipping_address", "delivery_date", "special_instructions"],
"ttl_seconds": 86400,
"reminder_intervals": [3600, 7200]
}
}
When execution reaches this step, the run pauses and waits for form submission.
Properties Reference
| Property | Type | Required | Description |
|---|---|---|---|
expected_keys |
string[] | Yes | Fields the form expects. Submission must include these keys |
ttl_seconds |
number | No | Time-to-live ā how long the form stays open before expiring (default: no expiration) |
reminder_intervals |
number[] | No | Seconds after creation to send reminders. [3600, 7200] sends reminders at 1 hour and 2 hours |
Submission Flow
Submitting Form Data
curl -X POST http://localhost:3009/forms/{runId}/0/submit \
-H "X-Org-Id: acme-corp" \
-H "Content-Type: application/json" \
-d '{
"shipping_address": "123 Main St, City, ST 12345",
"delivery_date": "2025-02-15",
"special_instructions": "Leave at door"
}'
/forms/:runId/:stepIndex/submitSubmit form data for a paused PbotForm step.
/forms/pendingList all pending form requests across the organization.
Context After Submission
The submitted data is added directly to the execution context. Each key from the submission becomes accessible via @path:
{
"type": "schedule_delivery",
"properties": {
"address": "@shipping_address",
"date": "@delivery_date",
"notes": "@special_instructions"
}
}
TTL and Expiration
When ttl_seconds is set, the form expires after the specified duration. If the form is not submitted before expiration, the workflow run fails with a timeout error.
Use TTL for time-sensitive workflows where stale input would be harmful ā for example, a vendor onboarding form that's only valid for 24 hours.
Reminder Intervals
The reminder_intervals array specifies when reminders should be sent (in seconds after the form is created). This triggers reminder webhook events that your application can use to send follow-up notifications.
{
"reminder_intervals": [3600, 7200, 43200]
}
This sends reminders at 1 hour, 2 hours, and 12 hours after the form is created.
PbotForm vs External Forms
Hyphen has two form mechanisms:
| Feature | PbotForm | External Forms |
|---|---|---|
| Purpose | Collect input within a workflow | Standalone data collection |
| Tied to a run | Yes ā pauses and resumes a workflow | No ā independent |
| Created via | Workflow step | POST /external-forms |
| Submissions | Single submission resumes the run | Multiple submissions collected |
| Best for | Vendor provides shipping details mid-workflow | Customer feedback survey |
ā Next: Custom Table