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 Event Streams for outbound message events (Plan limitations and overages apply)
- Access to Custom Events for inbound event syncing (Plan limitations and overages apply)
- 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
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
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
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