Creating a workflow with Mixpanel Cohort

Navigate to the Workflow section from the left navigation panel.

On the landing page of Workflow, you will see the Value proposition of Workflows. You can create a new workflow by clicking 'Create New Workflow'.

If you have already created few workflows, you can see the list of all the Workflows you have created in card view. You can click 'Create+' to create a new workflow.

Once you click 'Create+', a workflow canvas opens.

Prerequisites

  1. Ensure relevant notification events which will be configured as part of Workflow is created.
  2. Ensure at least 1 allowlist API is configured if you want to receive delivery reports.

How to configure a Trigger using Mixpanel cohort

  1. Drag and drop 'Mixpanel' under Triggers into the Workflow canvas.

  2. Custom Fields - This is Optional. By default, mixpanel_distinct_id and mixpanel_cohort_name will be sent for every Mixpanel cohort. If your cohort has additional fields, add it here.

  3. Cohort Name - Enter a cohort name. Make sure the name matches with the Cohort created in Mixpanel

  1. Every Mixpanel cohort can be associated with one of the 3 actions.
    1. First Run - Includes all the users during the initial cohort sync. Use this option if you want to do One Time Sync.
    2. Member added - Includes users who joined the cohort since the last sync
    3. Member removed - Includes users who left the cohort since the last sync.

Action

There are 2 possible actions you can add.

  1. Notification Event
  2. Cohort

1. Notification Event

Notification Event refers to the notification events created within Fyno's application and can be called in response to an action inMixpanel

On drag and drop of the Notification Event, you will see the

  1. Notification Event: Select a relevant Notification Event from the dropdown, specific to this Mixpanel action.

  2. Map Data : On selecting the notification event, you will see the Notification Event Mapping details. Basically, for the notification event that you have selected, you will need to specify which fields from the Mixpanel cohort correspond to the destination, data, callback etc.

    1. Distinct Id: If you are using Fyno's user profile, then select value for Distinct Id from the payload or a custom variable created using the Simplify option.
    2. Channels : All the channels configured as part of the template linked to the Notification Event selected will appear here. If you are not using Fyno's user profile, map the channel level destinations with a field from the Mixpanel cohort . In this example, the template linked to the notification event 'Onboarding_Routing' has only Email as the channel. That's why you see Email under Map data. Under Index for Destination, choose 'all' or you can add any specific index like 0,1 etc.
  3. Data: In this section, you will see all the fields that you have specified as Placeholders (variable parameters/dynamic values) in the Template that is associated with the Notification Event that was selected. In case you do not see this field, this means that there are no Placeholders in the Template.

  4. Additional Data: Additional data in the form of a payload can be specified here if required, in JSON format. This is an optional field. A typical use case for additional data is when you do not manually add placeholders during template creation. For instance, if your template contains the text Hi {{name}} but you do not explicitly specify name as a placeholder during template creation. Nevertheless, Fyno still identifies the name as a placeholder since it appears in the {{ }} syntax. In this scenario, you can include the value of the name in the Additional Data'section. To do this, specify the name as the key and select a corresponding value from the dropdown.

2. Cohorts

You can add multiple cohorts to the Mixpanel trigger as shown below. This helps you to add as many cohorts to a single Workflow and execute all your use cases.

📘

Cohorts can only be associated with Trigger nodes. It is not possible to add cohorts to Notification Event nodes.

How to receive Delivery Reports

  1. To configure callbacks to receive delivery reports, click the Settings icon as shown below.
  1. It opens the page as shown below. Select the 'Do you want to receive a delivery report?' checkbox.
  1. This option allows you to receive Delivery reports of each notification triggered in any URL you have allowlisted in Fyno. It can be done in 2 ways.
    1. From Allowlist - Selecting Delivery Report Endpoint(s) from Verified Allowlist URLs (Maximum 3 can be selected).
    2. Custom - Selecting Delivery Report Endpoint from payload or a simplified custom variable. (Only 1 can be selected).

Once the Delivery Endpoint URL(s) is selected, 3 additional placeholder details need to be configured.

PlaceholdersDefault ValueMeaning
Custom Idcustom_idID you provided in the callback.custom_id field while triggering the notification.
Custom Field 1msg_idMessage ID generated for every notification sent from Fyno.
Custom Field 2statusstatus of the message such as Delivered, Opened, Read etc.

More values can be added in the callback. For a list of additional available values, please see:

https://docs.fyno.io/docs/allowlist-url#callback-response

How to configure Overrides

This option allows you to configure dynamic parameters in Workflow. For instance, if you require using different email IDs for various notifications within an Workflow, you can achieve this by configuring overrides.

For instance, suppose you've set up [email protected] as the from_email address during SES integration configuration, but wish to utilize the value passed in 'email' parameter in the payload to initiate a notification within an Workflow. You can achieve this by following the steps below.

  1. Go to 'Override' tab under Settings as shown below.
  1. Select the value you want to use from the payload. For example, if you want to use the variable email from the payload for 'from_email', you can do it as shown above.

Workflow URL

Once you saved or saved and promoted your workflow, you need to copy the Workflow URL.

You can do that by clicking the ellipsis icon at the top right side next to 'Save' button.

The URL is auto-generated when you create the workflow. You will need to use this URL to invoke this Workflow.

We provide URLs for both Test and Live. Please copy both the URLs and configure it in your system or any third party tool where the webhook will be triggered.

Public:

If you are using Public URL, you will see the URL as shown below. You also need to configure the Username & Password while configuring webhook in Mixpanel.

📘

Workflows are public by default. If you enable the "Restricted" option after the workflow is created and save it with this setting, you must use "Restricted" URLs (Live & Test) when funning the workflow.

Restricted:

If you want to use Restricted access, enable the Restricted Toggle as shown below. You also need to configure the Username & Password while configuring webhook in Mixpanel.

📘

You can update the token using the "Customize Token" option in the Workflow details page header.

Since you can invoke the workflow URL from anywhere, it is a good idea to update the token if you feel it has been compromised. You must always remember to update the workflow URL (with the new token) at the source from where the workflow is called.