DEV Community

Max Katz for Okta Workflows

Posted on • Originally published at maxkatz.net on

How to Send a Notification to a Group of People Based on a Department

The Workflows team holds weekly community office hours where you can ask questions about your flows, ask about potential uses cases, and share what you are working on.

I am a starting a new series where I will be sharing questions and answers from the office hours as they are available how-to’s.

So here is the first questions.

How to send a notification to a group of people based on a department?

You are onboarding an employee and based on their department you want to send an email to a group of people associated with that department. It can be one group or multiple groups. For example, if the person is in the Engineering department an email should go to to that person plus a copy to eng1@company.com and eng2@company.com. And if the person is in the Marketing department, an email will go to that person plus a copy to marketing1@company.com

A flow to do that is below:

Send email based on department flow

Send email based on department flow

The flow uses a table to hold department emails and looks like this:

Department emails table

Department emails table

This is how the flow works:

  1. The first card On Demand – Helper Flow makes this a helper flow. The helper flow has two inputs Department and Primary email. A helper flow can be reused with other flows
  2. The second card Tables – Search Rows retrieves all emails associated with the particular department
  3. The result from Tables – Search Rows is a JSON object with five key/value pairs. The List – Pluck card removes (plucks) all key/value pair except the one specified in the key input (Email). After this step you have a list of email(s) to copy
  4. The last card Gmail – Send Email sends an email to the person who was onboarded (Primary email) and one or more department groups are copied ( CC input) on the email

Have a question about Workflows? Not sure how to build a flow? Join the weekly community office hours to get help.

Top comments (0)