Workflow Structure
Workflows are the foundational plans for every notification within Omni-Link Studio. These plans come with essential configurations for each message. Each message is associated with a particular channel, complete with a content template, code rules, filters, priorities, and additional metadata that collectively influence the delivery of that specific message.
Create a workflow
After configuring the designated communication channel, you can create your notification workflow. You can think of the workflow as the blueprint for the notifications that will be sent. The workflow includes:
- Workflow details
- Channel specific content
- Trigger
Workflow Details
The workflow name is transformed into a slug, serving as the trigger identifier. This identifier is crucial when initiating the trigger from the backend.
Channel specific content
SMS
Inside SMS, you can write text content and specify custom variables using {{handlebars}} syntax.
WhatsApp Business
Inside WAB, you can choose between writing a text or using a template and specify custom variables using {{handlebars}} syntax.
Email
You can specify the content for emails in two ways:
Visual workflow builderFor simple use cases, you can use our visual workflow editor. The visual workflow builder has limited control over design but is easier to get-started with.
Custom CodeYou can use the custom code section to specify custom html for the email.
You can specify custom variables using the {{handlebars}} syntax.
Voice
Inside Voice, you can input text content and create the voice message you wish to play during the call.
Subscribers
Subscribers are the recipients of notifications. A subscriber will contain the delivery details: Email address, phone number, and WhatsApp number.
Trigger
The trigger's role is to inform the system about an event and which workflow to activate in response. Each trigger should include the necessary variables and data for composing notification messages. If any required value is missing, the variable protection mode will activate, and the message won't be sent.
ImportantNote that triggers are responsible for indicating that an event has occurred, but they do not determine the location or timing of message delivery.
Trigger the workflow
After creating the workflow, Omni-Link Studio will automatically generate the trigger. To integrate it into your application, make use of the server SDK and place it in the relevant location for the specific trigger you've designed.
curl --location 'https://example.com/v1/events/trigger' \
--header 'Authorization: ApiKey <API KEY FROM SETTINGS PAGE>' \
--header 'Content-Type: application/json' \
--data '{
"name": "<REPLACE_WITH_EVENT_NAME_FROM_ADMIN_PANEL>",
"to": {
"subscriberId": "<USER_IDENTIFIER>"
},
"payload": {
customVariables: "XXXX",
}
}'The trigger function includes a parameters object as the second parameter. Let's explore its various options:
The to parameter contains the information about the subscriber of the notification. You can work with Omni-Link Studio in 2 modes:
- Pass only the subscriberId (Recommended):
{
to: 'SUBSCRIBER_ID',
payload: {}
}
In this approach, you only pass the subscriberId as part of the trigger.
- Pass the subscriber information in the trigger (Quickest)
You can pass the subscriber object containing the following keys as this parameter:
await omnilink.trigger('<REPLACE_WITH_EVENT_NAME_FROM_ADMIN_PANEL>', {
to: {
subscriberId: 'Unique Subscriber Identifier',
phone,
email,
},
payload: {},
});
The subscriberId serves as a personalized identifier within the Omni-Link Studio, uniquely identifying users.
When the trigger is activated, Omni-Link Studio performs an operation that either creates a new subscriber with the provided payload or updates an existing subscriber with the provided information.
Updated 6 months ago