Skip to main content

Automations

Automations allow you to create powerful workflows that respond to survey events automatically. Build complex logic with triggers, conditions, and actions to personalize the survey experience and integrate with external systems.

Overview

An automation workflow consists of:

  • Triggers: Events that start the workflow
  • Conditions: Logic to control flow (if/else)
  • Actions: Operations to perform (send messages, call APIs)
  • Parameters: Variables to store and use data

Workflow Triggers

Triggers are entry points that start your workflow. Choose the right trigger based on when you need the workflow to run.

Contact Added

Fires immediately when a contact is added to the collector, before the survey link is sent.

Use cases:

  • Fetch data from external APIs to use in the survey
  • Enrich contact data from your CRM
  • Calculate personalized values for survey questions
  • Set up conditional survey paths based on external data

Important: This is the only trigger that allows you to use workflow parameters in survey questions.

Survey Response Opened

Fires when a user clicks the survey link and the survey starts loading.

Use cases:

  • Track survey opens in external analytics
  • Send real-time notifications to your team
  • Update CRM records when contacts engage

Survey Response Completed

Fires when a user submits the completed survey.

Use cases:

  • Send thank-you emails
  • Deliver coupons based on responses
  • Push data to external systems via webhooks
  • Trigger follow-up campaigns

Step Types

Logic: If/Else Condition

Create branching logic based on conditions.

Supported operators:

  • Comparison: >, >=, <, <=, ==, !=
  • String: contains, startsWith, endsWith
  • Null checks: isEmpty, isNotEmpty

Example conditions:

survey.score >= 80
params.customerTier == 'VIP'
contact.email contains '@company.com'

Actions: Send Messages

Send Email

Send a personalized email to the contact.

Configuration:

  • To: Contact email (usually {contact.email})
  • Subject: Email subject with variable support
  • Body: Rich HTML content with personalization

Send SMS

Send an SMS message to the contact's phone number.

Configuration:

  • To: Contact phone (usually {contact.phone})
  • Message: Text content (160 character limit for single SMS)

Send WhatsApp

Send a WhatsApp message using your configured provider.

Configuration:

  • To: Contact phone with country code
  • Template: Pre-approved WhatsApp template
  • Variables: Dynamic values to fill template placeholders

Send Coupon (Email/SMS/WhatsApp)

Generate and send a coupon code from your coupon pool.

Configuration:

  • Coupon Group: Select the coupon pool to draw from
  • Delivery Method: Email, SMS, or WhatsApp
  • Message: Customize the delivery message

Integration: HTTP Request

Make API calls to external services.

Configuration:

  • Method: GET, POST, PUT, PATCH, DELETE
  • URL: Endpoint with variable interpolation
  • Headers: Custom headers (authentication, content type)
  • Body: Request payload (JSON supported)
  • Response Mapping: Extract values from the response

Example:

URL: https://api.yourcrm.com/customers/{{contact.email}}
Method: GET
Headers:
Authorization: Bearer your-api-key
Response Mapping:
$.tier → customerTier
$.loyaltyPoints → loyaltyScore

Data: Set Value

Create or update workflow parameters.

Configuration:

  • Target: Parameter name (e.g., params.discount)
  • Value Type: Literal, Variable, or Expression
  • Value: The value to set

Example:

Target: params.discountPercent
Value Type: Expression
Value: survey.score >= 90 ? 20 : 10

Workflow Parameters

Workflow parameters are temporary variables that exist during workflow execution.

Creating Parameters

Parameters can be created:

  1. Manually: Click "Add Parameter" in the Parameters modal
  2. From HTTP Response: Map API response fields to parameters
  3. From Set Value: Create calculated values

Using Parameters

Reference parameters in configurations:

  • In workflows: {{params.parameterName}}
  • In surveys: {parameterName} (when "In Survey" is checked)

Include in Survey

Check "In Survey" to make a parameter available in survey questions:

  • Uses SurveyJS setVariable() under the hood
  • Requires "Contact Added" trigger to work
  • Available via {parameterName} syntax in questions
tip

See the Variables & Personalization guide for detailed examples of using parameters in surveys.

Building a Workflow

Step 1: Add a Trigger

  1. Open the Automation tab in your collector
  2. Click "Add Step"
  3. Select a trigger type from the palette
  4. Drag it to the canvas

Step 2: Add Actions

  1. Click "Add Step"
  2. Choose an action (Send Email, HTTP Request, etc.)
  3. Connect it to your trigger
  4. Configure the action settings

Step 3: Add Conditions (Optional)

  1. Add an If/Else Condition step
  2. Configure the condition logic
  3. Connect the Yes branch to one action
  4. Connect the No branch to another action

Step 4: Configure Parameters (Optional)

  1. Click the Parameters button
  2. Add or configure parameters
  3. Check "In Survey" for parameters needed in questions

Step 5: Test and Activate

  1. Review your workflow
  2. Test with a sample contact
  3. Check execution logs
  4. Activate the collector

Examples

Example 1: VIP Customer Detection

Goal: Fetch customer tier from CRM and show VIP-specific questions.

Workflow:

[Contact Added] → [HTTP Request: Get Customer] → [Set Value: isVIP]

Configuration:

  1. HTTP Request to your CRM API
  2. Map $.tier to params.customerTier
  3. Check "In Survey" for customerTier
  4. Use {customerTier} in survey questions

Example 2: Score-Based Coupon

Goal: Send coupons only to respondents with high scores.

Workflow:

[Survey Completed] → [Condition: score >= 80]
├─ Yes → [Send Coupon Email]
└─ No → [Send Thank You Email]

Example 3: Real-Time CRM Update

Goal: Update CRM when survey is completed.

Workflow:

[Survey Completed] → [HTTP Request: Update CRM]

Configuration:

  • Method: POST
  • URL: https://api.yourcrm.com/surveys
  • Body: Survey response data

Best Practices

  1. Choose the right trigger:

    • Contact Added → Pre-survey enrichment
    • Survey Opened → Analytics/tracking
    • Survey Completed → Post-survey actions
  2. Handle errors gracefully:

    • Use conditions to check if API calls succeeded
    • Provide fallback paths for failures
  3. Keep workflows simple:

    • Break complex logic into multiple smaller workflows
    • Use descriptive step names
  4. Test thoroughly:

    • Test with sample data before launch
    • Monitor execution logs for errors
  5. Document your workflows:

    • Add descriptions to steps
    • Keep a record of parameter purposes

Troubleshooting

Workflow not triggering

  • Check collector status: Ensure the collector is active
  • Check trigger: Verify the correct trigger is configured
  • Check step connections: Ensure all steps are connected

HTTP request failing

  • Check URL: Verify the endpoint is correct
  • Check authentication: Ensure API keys are valid
  • Check payload: Validate JSON body format
  • Check logs: Review execution logs for error details

Parameters not available in survey

  • Check trigger: Must use "Contact Added" trigger
  • Check "In Survey": Checkbox must be enabled
  • Check syntax: Use {parameterName} not {{params.parameterName}}

Messages not sending

  • Check contact data: Verify email/phone are present
  • Check provider config: Ensure email/SMS providers are configured
  • Check coupon pool: Verify coupons are available if using coupon actions
Was this page helpful?