Overview
The OneSignal + MotherDuck integration enables automatic syncing of custom events from your MotherDuck databases to OneSignal to trigger automated messaging campaigns and Journeys based on user behavior. MotherDuck is a DuckDB-in-the-cloud service that provides fast OLAP (Online Analytical Processing) capabilities with the simplicity of SQL.Requirements
- Access to Custom Events (currently in beta)
- Updated Account Plan (not available on free apps).
MotherDuck
- MotherDuck account with database access
- Service token for authentication
- Database containing event data
- Tables or views with structured event information
Setup
1
Create MotherDuck service token
Generate an access token for OneSignal to connect to MotherDuck:
- Log in to the MotherDuck Web UI at
app.motherduck.com
- Click your profile in the top-left corner
- Navigate to Settings > General > Access Tokens
- Click Create Token
- Set expiration date (or leave unlimited)
- Copy the generated service token
2
Prepare your event data
Ensure your MotherDuck database contains properly structured event tables:
3
Connect to OneSignal
In OneSignal, go to Data > Integrations and click Add Integration.Select MotherDuck and provide:
- Service Token: Token from Step 1
- Database Name: Your MotherDuck database name
- Connection String:
md:your_database_name
4
Configure data sync
Select the tables or write custom SQL queries to define which event data to sync:
Event data mapping
Map your to OneSignal’s custom events format:OneSignal Field | Description | Required | |
---|---|---|---|
name | event_name | Event identifier | Yes |
external_id | user_id | User identifier | Yes |
timestamp | event_timestamp | When event occurred | No |
properties | event_data | No |
Example Event Query
Processing Modes
Table Mode
Sync entire tables directly from your MotherDuck database. OneSignal will automatically map columns to event fields.SQL Query Mode
Write custom DuckDB SQL queries to transform and filter your event data:Limitations
- Query complexity affects sync performance
- Large result sets may impact sync speed
- JSON parsing requires proper column typing