Destinations (Code Config)

Last Updated: 2021-10-12

Destinations are the last step in the Grouparoo configuration process. That means you should have already configured at least one App, Source, Property, and Group.

Once you have all other items configuration, you're ready to send your customer data to Destinations. Destinations are the last piece of the puzzle. They are the place(s) you want to send your customer data so you can take action on your workflows. These Destinations can be email marketing tools like Marketo, SendGrid, or Braze. Destinations can also be data tools like Redshift or Snowflake. See this doc to learn more about the core concepts in Grouparoo.

Generating a New Destination

To generate a new Destination for your Grouparoo application, run the generate command.

For example, let's say you have configured a Mailchimp App with the ID mailchimp. You can generate a new Mailchimp Destination (from a table in the database) like this:

grouparoo generate mailchimp:email:destination newsletter --parent mailchimp_app

Note here that newsletter is the ID for the Destination. An ID is always required when generating a config object.

This command will generate a file in your application directory at config/destinations/mailchimp.js that looks something like this:

exports.default = async function buildConfig() {
  return [
      id: "newsletter",
      name: "newsletter",
      class: "destination",
      type: "mailchimp-export",
      appId: "...",
      collection: "...",
      groupId: "...",
      syncMode: "...",
      options: {
        listId: "...",
      mapping: {
        email_address: "email",
        FNAME: "firstName",
        LNAME: "lastName",
      destinationGroupMemberships: {
        "High Value Customers!": "highValueCustomers",

See below for more information about this file.

List of Available Destination Types

Postgres is just one type of Destination you can create. To see a full list of available types, use the --list option, filtered by "Destination":

grouparoo generate destination --list

This will give you something like the following:

facebook:destination (id, parent) - Config for a facebook Destination
hubspot:destination (id, parent) - Config for a hubspot Destination
intercom:destination (id, parent) - Config for a intercom Destination
iterable:destination (id, parent) - Config for a iterable Destination
mailchimp:email:destination (id, parent) - Config for a Mailchimp Email Destination
mailchimp:id:destination (id, parent) - Config for a Mailchimp ID Destination. Note: Use the email Destination unless you know you need this.
marketo:destination (id, parent) - Config for a marketo Destination
mysql:destination (id, parent) - Config for a mysql Destination
postgres:destination (id, parent) - Config for a postgres Destination
redshift:destination (id, parent) - Config for a redshift Destination
sailthru:destination (id, parent) - Config for a sailthru Destination
salesforce:destination (id, parent) - Config for a salesforce Destination
sendgrid:destination (id, parent) - Config for a sendgrid Destination
zendesk:destination (id, parent) - Config for a zendesk Destination

This list is determined by the plugins that you have installed. Learn more about Plugins.

Configuring Your Destination

Each Destination has a common set of options, while other options are specific to the type of Destination. Here are the commons set of options that may look similar to other config object shapes in Grouparoo:

  • id: (required) The unique value that defines this Destination.
  • name: (required) A display name for the Destination. Will be set to the id by default.
  • class: (required) Should be set to "Destination".
  • type: (required) The type of Destination will vary based on the Generator you're using. You likely don't want to change this value.
  • appId: (required) The id of the App (connection) that the Destination uses.
  • collection: (required) Which records should be exported from this Destination? You can choose "group", "model", or "none".
  • groupId: The id of the Group whose members should be exported to the Destination. (This is where Groups in Grouparoo really come in handy.) You need to choose collection: "group" to choose a groupId.
  • syncMode: (required): The SyncMode you wish to use for this Destination. Options are "Sync", "Additive", and "Enrich".
  • mapping: See below.
  • destinationGroupMemberships: See below.

The Generator attempts to make a reasonable guess at the values in the config file it generated (in the config/destinations directory). There are ellipses ("...") in the places in which it couldn't make a reasonable guess. In the example above, after generating a Postgres App, all but appId, groupId, and options.listId were pre-populated.

The best practice when configuring an Destination is to read the comments, keys, and values within the generated file and fill in the appropriate values for your Destination.

In addition, Destinations have the concept of Mappings and Group Memberships. See below for more info.

Destination Mappings

Mappings are a series of key-value pairs that tell Grouparoo which Properties to export to the Destination for each Record. The structure may vary for each type of Destination, but generally, the keys are the fields in the Destination, while the values are the id values for the Properties in Grouparoo.

Here's an example of a Mailchimp mapping configuration:

  mapping: {
    email: "email",
    FNAME: "firstName",
    LNAME: "lastName",

Notice the odd structure of the keys. That's specific to Mailchimp. Each Destination's config file will be generated will some helper comments to get you started.

Destination Group Membership

Grouparoo also provides the ability to attach Group membership to the exported data. How this looks within the Destination is specific to the Destination. But the shape of the config file largely remains the same. In most Destinations, Destinations Group Memberships become either tags (Mailchimp), lists (Hubspot), or appended as additional properties to the Record (

destinationGroupMemberships are a set of key-value pairs that tell Grouparoo which memberships to publish to the Destination. For example, you may have sent all your users to a Mailchimp Destination, but you wanted to tag high-value customers. That config might look something like this:

  destinationGroupMemberships: {
    "High Value Customers!": "highValueCustomers",

Here the key represents the tag in Mailchimp, while the value is the id of the Group in Grouparoo.

Validating & Applying Your Config

You can validate your config at any time using the validate command:

$ grouparoo validate

And you can apply that config (save it to your Grouparoo application's database) using the apply command:

$ grouparoo apply