Event Types
Create reusable webhook schemas that can be shared across multiple workflows. Define your event structure once and use it everywhere.
Table of Contents
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_name→lead.name(string, required)lead_phone→lead.phone(string, required)property_address→property.address(string)lead_id→lead.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
- Go to Organization Management (click your organization name in the navigation)
- Click "Manage Event Types" in the Event Types section
- Or navigate directly to
/organizations/{organization-id}/event-types
Step 2: Create New Event Type
- Click "Create Event Type"
This opens the event type creation form - 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
- 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.nameoritems[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
- Paste Sample JSON
In the "Quick Import from JSON" field, paste a sample webhook payload - Click "Discover Fields"
The system will analyze the JSON and identify all fields, their types, and sample values - Select Fields to Add
Review the discovered fields and select which ones you want to add to your event type schema - 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_namelead.phone(string) →lead_phoneproperty.address(string) →property_addressproperty.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
- Initial Version
When you create an event type, it starts at version 1 - Creating New Versions
When you edit and save an event type, a new version is created (version 2, 3, etc.) - Version History
All previous versions are preserved and linked together - 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:
- Go to the workflow edit page
- If the workflow is using an older version, you'll see an "Upgrade to Latest" button
- Click the button to upgrade the workflow to use the latest version
- 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
- Create or Edit a Workflow
Go to the workflow builder and add or edit a webhook trigger - Configure the Trigger
In the trigger configuration, you'll see a "Use Existing Event Type" dropdown - 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. - 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
- Click "Edit" on the event type you want to modify
- Make your changes to the name, description, or field mappings
- Click "Update" to save
- 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:
- Click "Delete" on the event type
- Confirm the deletion
- 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.