Add I-130a to I-130
Definition Template
{ "actions": [ { "type": "AddAdditionalForm", "config": { "form_id": "form_WXledkxaJOqdZCgpoNbYLD9r" } } ], "trigger": { "type": "FormCompleted", "config": { "form_id": "form_ozg5aBZRmG07Nh0Q97MXEPvL", "conditions": [ { "type": "form_field_checked", "field": "form1_0_subform_0_pt1line1_spouse_0" } ] } } }
Automation Definition Documentation:
Basic structure of an automation definition with all possible components.
{
"trigger": {
"type": "trigger_name",
"config": { ... }
},
"actions": [
{
"id": "unique_action_id", // Optional
"type": "action_name",
"config": { ... }
}
]
}
Available Triggers
Events that can start an automation. Specify one in the trigger.type
field.
FormCreated
Triggered when a client initiates a form.
Configuration
{ "type": "FormCreated", "config": { "form_id": "form_123", // or "*" for any form } }
FormCompleted
Triggered when a client completes a form.
Configuration
{ "type": "FormCompleted", "config": { "form_id": "form_123" // or "*" for any form } }
DocumentRequestCompleted
Triggered when a document request is marked as completed.
Configuration
{ "type": "DocumentRequestCompleted", "config": { "document_request_template_id": "template_123" // or "*" for any template } }
DocumentSignedByAll
Triggered when all parties have signed a document.
Configuration
{ "type": "DocumentSignedByAll", "config": { "signable_document_template_id": "template_123" } }
FinalizedFormPdf
Triggered when all required intake form PDFs are finalized (filled and/or signed). Useful for combining multiple forms into a single package.
Configuration
{ "type": "FinalizedFormPdf", "config": { "forms": [ { "id": "form_123", "generation_type": "form_filled" // For regular filled forms }, { "id": "form_456", "generation_type": "signable_from_filled" // For forms that need signatures }, { "id": "form_789", "generation_type": "signable_from_filled", "conditions": [ // Optional conditions { "type": "form_field_checked", "field": "spouse_checkbox", "form_id": "form_456" } ] } ] } }
Notes:
- All forms in the config must have their corresponding PDFs generated and attached
- For
form_filled
type, checks for filled PDF documents - For
signable_from_filled
type, checks for signed PDF documents - Conditions are optional and work the same as other triggers
- Useful for combining multiple forms into a single package when all required documents are ready
StageUpdated
Triggered when a record's stage changes.
Configuration
{ "type": "StageUpdated", "config": { "from_stage_id": "stage_123", // Optional (unless "to_stage_id" is missing) "to_stage_id": "stage_456" // Optional (unless "from_stage_id" is missing) } }
AutomationCompleted
Triggered when another automation completes successfully.
Configuration
{ "type": "AutomationCompleted", "config": { "automation_id": "auto_123" } }
Available Actions
Tasks that can be performed when a trigger occurs. Add to the actions
array.
CreateAccessGrant
Grants access to documents for a specific user.
Configuration
{ "type": "CreateAccessGrant", "config": { "access_grant": { "name": "Client Access", "account_user_id": "act_user_123", // or "client" "expiry_days": 30, "document_selection_rule": { "name": "Selected Documents", "conditions": { "tags": ["important", "shared"], "created_via": ["client_portal", "agent_portal"], } } } } }
CreateDocumentRequest
Creates a document request for the matter.
Configuration
{ "type": "CreateDocumentRequest", "config": { "document_request_template_id": "template_123" } }
CreateSignableDocument
Creates a signable document from a template.
Configuration
{ "type": "CreateSignableDocument", "config": { "signable_document_template_id": "template_123", }, "role_mappings": { "client": "act_user_123" // or "client" for automapping to the matter's client } }
UpdateStage
Updates the stage of the matter.
Configuration
{ "type": "UpdateStage", "config": { "new_stage_id": "stage_123" } }
AddAdditionalForm
Creates a new form based on a specified IntakeForm id, linked to the matter.
Configuration
{ "type": "AddAdditionalForm", "config": { "form_id": "form_123" } }
SyncFormFields
Syncs field values from one form to another within the same matter. Supports syncing from form fields or from predefined values like client email.
Configuration
{ "type": "SyncFormFields", "config": { "source_form_id": "form_456", // The source form's prefix_id "target_form_id": "form_456", // The target form template's prefix_id "field_mappings": [ { "source_field": "petitioner_name", "target_field": "petitioner_name" }, { "source_field": "petitioner_email", "target_field": "petitioner_email", "transform": "uppercase" // Optional: transform value (uppercase, lowercase, strip) }, { "source_value": "client.email", "target_field": "petitioner_email" } ] } }
Notes:
- Target form must exist in the same matter as the source form
- Field values are only updated if they differ from current values
- Empty source values are skipped
- Sync will apply to all source or target forms in the matter matching the form ids
- Use
source_field
to sync from form field values - Use
source_value
to sync from predefined values (currently supportsclient.email
) - Cannot use both
source_field
andsource_value
in the same mapping
CombineFormPdfs
Combines multiple form PDFs into a single document, maintaining the order specified in the config. Supports both filled forms and signed documents.
Configuration
{ "type": "CombineFormPdfs", "config": { "output_name": "Combined I-130 Package", "forms": [ { "id": "form_123", "generation_type": "form_filled" // For regular filled forms }, { "id": "form_456", "generation_type": "signable_from_filled", // For forms that need signatures "conditions": [ // Optional conditions { "type": "form_field_checked", "field": "spouse_checkbox", "form_id": "form_456" // Required: must specify which form to check } ] } ] } }
Notes:
- Combines PDFs in the order specified in the forms array
- For
form_filled
type, uses the filled PDF document - For
signable_from_filled
type, uses the signed PDF document - Conditions are optional and work the same as other triggers
- When using conditions,
form_id
is required to specify which form to check
SendNotification
Sends an in-app notification and optionally an email to a client or specific user.
Configuration
{ "type": "SendNotification", "config": { "recipient": "client", // "client", "firm", or "act_user_123" "message": "Your documents are ready for review", "title": "Documents Ready", // Required when send_email is true "send_email": true, // Optional: true/false "tab": "documents" // Optional: tab to open when clicking the link (dashboard, documents, tasks, etc.) } }
Notes:
- Use "client" to notify the matter's client (matter.user)
- Use "firm" to notify all users in the matter's account
- Use account_user_id to notify specific user (e.g., "act_user_123")
- Always sends in-app notification, email is optional
- URLs are automatically routed to the matter at hand based on recipient type (client, agent, firm)
- Tab parameter opens specific tab when clicking the matter link (dashboard, documents, tasks, deadlines, etc.)
CreateTaskList
Creates multiple tasks for the matter. Tasks are created unassigned by default and can be assigned later.
Configuration
{ "type": "CreateTaskList", "config": { "tasks": [ { "name": "Review client documents", "description": "Review all submitted client documents for completeness", "due_date": "2024-01-15", // Specific date "priority": "high" }, { "name": "Prepare filing package", "description": "Prepare the complete filing package for submission", "due_date": { "days_from_now": 7 }, // Relative date "priority": "normal" }, { "name": "Schedule client meeting", "description": "Schedule follow-up meeting with client", "due_date": { "weeks_from_now": 2 }, // Relative date "priority": "low" } ] } }
Notes:
- Tasks are created unassigned and can be assigned later
- Due dates can be specified as specific dates or relative dates
- Priority can be: low, normal, high, emergency (defaults to normal)
- All tasks are associated with the matter from the context
Trigger Conditions
Rules that determine if a trigger should fire based on form field values.
Available Condition Types
form_field_checked
: Checks if a checkbox field is checked. Requiresform_id
to specify which form to check.form_field_equals
: Checks if a field exactly matches a valueform_field_contains
: Checks if a field contains a value
Logical Operators
AND
: All conditions must be true (default)OR
: At least one condition must be trueXOR
: Exactly one condition must be true
Examples
{ // Simple AND (all conditions must be true) "config": { "form_id": "form_123", "conditions": [ { "type": "form_field_checked", "field": "i130_checkbox" }, { "type": "form_field_equals", "field": "immigration_status", "value": "permanent_resident" } ] } // OR operator (any condition can be true) "config": { "form_id": "form_123", "conditions": { "operator": "OR", "conditions": [ { "type": "form_field_checked", "field": "i130_checkbox" }, { "type": "form_field_checked", "field": "i485_checkbox" } ] } } // Complex nested conditions "config": { "form_id": "form_123", "conditions": { "operator": "AND", "conditions": [ { "type": "form_field_checked", "field": "immigration_case" }, { "operator": "OR", "conditions": [ { "type": "form_field_equals", "field": "case_type", "value": "i130" }, { "type": "form_field_equals", "field": "case_type", "value": "i485" } ] } ] } } // Form field checked condition (requires form_id) { "type": "form_field_checked", "field": "i130_checkbox", "form_id": "form_123" // Required: specifies which form to check } // In FinalizedFormPdf trigger "config": { "forms": [ { "id": "form_123", "generation_type": "signable_from_filled", "conditions": [ { "type": "form_field_checked", "field": "spouse_checkbox", "form_id": "form_456" // Required: specifies which form to check } ] } ] } // In CombineFormPdfs action "config": { "forms": [ { "id": "form_123", "generation_type": "signable_from_filled", "conditions": [ { "type": "form_field_checked", "field": "spouse_checkbox", "form_id": "form_456" // Required: specifies which form to check } ] } ] } }