Event Types

Create reusable webhook schemas that can be shared across multiple workflows. Define your event structure once and use it everywhere.

Overview

Event types are reusable webhook schemas that define the structure of incoming webhook data. Instead of configuring the same schema for each workflow, you can create an event type once and reuse it across multiple workflows.

Key Benefits: Event types provide consistency, maintainability, and reusability. When you update an event type, you can upgrade all workflows using it to the latest version, or keep them on their current version for backward compatibility.

What are Event Types?

An event type defines the structure and mapping of incoming webhook payloads:

  • Name: A descriptive name for the event type (e.g., "Rental Lead Created")
  • Event Type Identifier: A unique identifier used to categorize events (e.g., "rental_lead.created")
  • Field Mappings: JSON paths that map webhook payload fields to template variables
  • Data Types: The type of each field (string, number, boolean, object, array)
  • Required Fields: Fields that must be present in the webhook payload

Example Event Type

For a rental lead webhook, you might define:

  • Name: "Rental Lead Created"
  • Event Type: "rental_lead.created"
  • Fields:
    • lead_namelead.name (string, required)
    • lead_phonelead.phone (string, required)
    • property_addressproperty.address (string)
    • lead_idlead.id (number)

When a webhook is received, these fields are automatically extracted and made available as template variables like {lead_name}, {lead_phone}, etc.

Creating Event Types

Step 1: Navigate to Event Types

  1. Go to Organization Management (click your organization name in the navigation)
  2. Click "Manage Event Types" in the Event Types section
  3. Or navigate directly to /organizations/{organization-id}/event-types

Step 2: Create New Event Type

  1. Click "Create Event Type"
    This opens the event type creation form
  2. Enter Basic Information
    • Name: A descriptive name (e.g., "Rental Lead Created", "Contact Form Submission")
    • Description: Optional description explaining when this event type is used
  3. Configure the Schema
    • Event Type Identifier: A unique identifier (e.g., "rental_lead.created")
    • Field Mappings: Define how webhook payload fields map to template variables

Step 3: Define Field Mappings

For each field you want to extract from the webhook payload:

  • Field Name: The name that will be used as a template variable (e.g., lead_name)
  • JSON Path: The path to the field in the webhook payload (e.g., lead.name or items[0].id)
  • Data Type: The type of the field (string, number, boolean, object, array)
  • Required: Whether this field must be present in the webhook payload

JSON Path Examples

// Simple field
lead.name → "John Doe"

// Nested field
contact.address.city → "San Francisco"

// Array element
items[0].id → 12345

// Nested array
orders[0].items[1].price → 29.99

Step 4: Save the Event Type

Click "Create" to save the event type. It will be immediately available for use in all workflows within your organization.

Quick Import from JSON

Instead of manually defining each field, you can paste a sample JSON payload and let Doone Flow automatically discover and map the fields.

How It Works

  1. Paste Sample JSON
    In the "Quick Import from JSON" field, paste a sample webhook payload
  2. Click "Discover Fields"
    The system will analyze the JSON and identify all fields, their types, and sample values
  3. Select Fields to Add
    Review the discovered fields and select which ones you want to add to your event type schema
  4. Fields Are Added Automatically
    Selected fields are added with their JSON paths and data types pre-configured

Example

Paste this sample JSON:

{
  "lead": {
    "name": "John Doe",
    "phone": "+1234567890",
    "email": "john@example.com"
  },
  "property": {
    "address": "123 Main St",
    "price": 250000
  }
}

The system will discover fields like:

  • lead.name (string) → lead_name
  • lead.phone (string) → lead_phone
  • property.address (string) → property_address
  • property.price (number) → property_price

Versioning System

Event types support versioning to allow safe schema evolution. When you update an event type, a new version is created automatically, preserving all previous versions.

How Versioning Works

  1. Initial Version
    When you create an event type, it starts at version 1
  2. Creating New Versions
    When you edit and save an event type, a new version is created (version 2, 3, etc.)
  3. Version History
    All previous versions are preserved and linked together
  4. Workflow Compatibility
    Workflows continue using their current version until you explicitly upgrade them

Important: Versioning ensures backward compatibility. Existing workflows will continue to work with their current version, even if you create a new version with different fields.

Viewing Versions

On the Event Types page, you can:

  • See the current version number for each event type
  • Click "Show Versions" to see all versions of an event type
  • View when each version was created
  • See which version each workflow is using

Upgrading Workflows

When a newer version of an event type is available:

  1. Go to the workflow edit page
  2. If the workflow is using an older version, you'll see an "Upgrade to Latest" button
  3. Click the button to upgrade the workflow to use the latest version
  4. The workflow will now use the new schema fields

Note: After upgrading, make sure your workflow actions are compatible with the new schema. New fields will be available, but removed fields will no longer work.

Using Event Types in Workflows

Selecting an Event Type

  1. Create or Edit a Workflow
    Go to the workflow builder and add or edit a webhook trigger
  2. Configure the Trigger
    In the trigger configuration, you'll see a "Use Existing Event Type" dropdown
  3. Select an Event Type
    Choose the event type you want to use from the dropdown. Only the latest version of each event type is shown by default.
  4. Schema is Applied Automatically
    The workflow will automatically use the schema from the selected event type

Using Template Variables

Once an event type is selected, all its fields become available as template variables in your workflow actions:

Example: SMS Action

If your event type defines lead_name and lead_phone, you can use them in SMS messages:

Hi {lead_name}, thank you for your interest! We'll contact you at {lead_phone}.

Example: Salesforce Action

Use event type fields in Salesforce payloads:

{
  "FirstName": "{lead_name}",
  "Phone": "{lead_phone}",
  "Email": "{lead_email}",
  "LeadSource": "Webhook"
}

Version Information

When editing a workflow that uses an event type:

  • You'll see which version of the event type is currently in use
  • If a newer version is available, an "Upgrade to Latest" button will be shown
  • You can upgrade to the latest version or continue using the current version

Managing Event Types

Viewing Event Types

The Event Types page shows all event types in your organization:

  • Latest Versions: By default, only the latest version of each event type is displayed
  • Version Information: Each event type shows its current version number
  • Version History: Click "Show Versions" to see all versions of an event type
  • Field Count: See how many fields are defined in each event type

Editing Event Types

  1. Click "Edit" on the event type you want to modify
  2. Make your changes to the name, description, or field mappings
  3. Click "Update" to save
  4. A new version will be created automatically

Note: Editing an event type creates a new version. Existing workflows will continue using their current version until you upgrade them.

Deleting Event Types

To delete an event type:

  1. Click "Delete" on the event type
  2. Confirm the deletion
  3. All versions of the event type will be deleted

Warning: Deleting an event type will affect all workflows using it. Make sure no workflows are using the event type before deleting, or update those workflows to use a different event type or custom schema.

Best Practices

Naming Conventions

  • Event Type Names: Use descriptive, human-readable names (e.g., "Rental Lead Created", "Contact Form Submission")
  • Event Type Identifiers: Use lowercase with underscores (e.g., "rental_lead.created", "contact_form.submitted")
  • Field Names: Use snake_case for consistency (e.g., lead_name, property_address)

Schema Design

  • Only Map What You Need: Don't map every field from the webhook payload. Only map fields you'll actually use in workflows.
  • Use Descriptive Field Names: Field names should clearly indicate what data they contain
  • Mark Required Fields: Only mark fields as required if they're essential for your workflows
  • Test Your Schema: Send a test webhook to verify fields are extracted correctly

Versioning Strategy

  • Additive Changes: When possible, add new fields rather than removing existing ones
  • Document Changes: Use the description field to document what changed in each version
  • Test Before Upgrading: Test workflows with new versions in a development environment before upgrading production workflows
  • Gradual Rollout: Upgrade workflows one at a time to ensure everything works correctly

Organization

  • Group Related Events: Use consistent naming to group related event types (e.g., "rental_lead.created", "rental_lead.updated")
  • Document Event Types: Use descriptions to explain when and how each event type is used
  • Review Regularly: Periodically review event types to remove unused ones and consolidate duplicates

Next Steps

Now that you understand event types, learn how to use them in your workflows and configure integrations.