Overview
The Create Customer action creates a new customer in your CaptainBook system. Use this to automatically create customer records from external systems, webhooks, or other workflow triggers.
Configuration
Name (Required)
The customer's name. Must be at least 3 characters. Supports variables.
Optional Fields
Contact Information
email- Primary email address (validated)secondary_email- Secondary email address (validated)phone- Phone number (validated)country- Country code (CCA2 or CCA3 format)
Address
address- Street addresscity- Cityregion- State/regionzip_code- Postal code
Preferences
locales- Preferred languages (array or comma-separated string)
Custom Attributes
extra_attributes- Array of key-value pairs for custom customer attributes
Output
Returns the created customer object in the workflow context with all customer details:
Contact information (name, email, phone)
Address information
Preferences and locales
Custom attributes
Accessing Customer Data
After this action, you can access:
{customer.id}
{customer.name}
{customer.email}
{customer.phone}
{customer.country}Examples
1. Basic Customer Creation
Name: John Doe
Email: [email protected]
Phone: +1234567890
2. Customer with Address
Name: Jane Smith
Email: [email protected]
Address: 123 Main St
City: New York
Region: NY
Zip Code: 10001
Country: US
3. Customer with Preferences
Name: Maria Garcia
Email: [email protected]
Locales: en,es
4. Customer with Custom Attributes
Name: Test Customer
Email: [email protected]
Extra Attributes:
- key: source
value: webhook
- key: campaign
value: summer2024
Validation
The action validates:
Name must be at least 3 characters
Email format (RFC and DNS validation)
Phone number format (international)
Country code (must be valid CCA2 or CCA3)
Best Practices
Validate input - Ensure required fields are present
Check duplicates - Consider checking for existing customers before creating
Handle errors - Set up error notifications for validation failures
Use variables - Leverage workflow context variables for dynamic data
Set origin - Customer is automatically marked as created by the workflow
