DEV Community

Max Katz for Okta Workflows

Posted on • Originally published at maxkatz.net on

Workflows Tips #8 – Time-Based Use Cases, User Sign in Attempt Card, and Flow Backup to GitHub or Google Drive

Welcome to another Okta Workflows Tips post. Read all other tips.

In this post:

  • Set table column field type correctly for time-based use cases
  • Get notified when a user signs-in outside a participating country
  • Automatically backup a flow or a folder to GitHub or Google Drive

Set table column field type correctly for time-based use cases

⭐ This tip is from Ajay Seetharam, Cloud Enterprise Architect at Okta.

In many time-based use cases there is a need to execute a workflow based on a schedule and then retrieve the rows that have a timestamp before the current date-time. For the search rows condition to work correctly the column field type has to be set to Date.

Setting column type in a table

Setting column type in a table

So an entry in such a table would be populated as shown in the example below:

Workflows table

Workflows table

The table is used in a flow with a date comparison to retrieve all rows prior to the current date-time

Searching a table by date

Searching a table by date

This picks out the correct row:

Testing a card

Testing a card

Unexpected rows would be returned from the Table – Search Rows card if the column type is set to the default text.

Get notified when a user signs-in outside a participating country

⭐ This tip is from Ashwin Ramnarayanan, Solutions Engineer at Okta.

Get a notification when a user signs-in into your organization from outside a participating country. Keep a list from which countries users are allowed to sign-in. When a sign-in occurs from a country not on the list, you will be notified. This flow uses Okta – User Sign In Attempt card. This event has information from where geography the sign-in happened.

Flow to get notified when a sign-in happens outside of a participating country

Flow to get notified when a sign-in happens outside of a participating country

The flow works like this:

  1. User attempts to sign-in ( User Sign In Attempt ) event
  2. Retrieve geographical information and whether the attempt was successful ( Object – Get Multiple )
  3. Search a table to see if the sign-in country matches one of the allowed countries from the list ( Tables – Search Rows )
  4. If a country was found ( Branching -Continue If ) and a sign-in was successful ( Branching -Continue If), create a message ( Text – Compose )
    • The message can be sent via email, as a Slack message, or SMS

Table with participating countries

Table with participating countries

Automatically backup a flow or a folder to GitHub or Google Drive

Use Flow – Export Flow card and Folders – Export Folders card to save and back a flow or a folder to GitHub or Google Drive.

Back up a flow or a folder

Back up a flow or a folder

Example of a flow that saves backups another flow to Google Drive:

Uploading flow backup to Google Drive

Uploading flow backup to Google Drive

You can schedule to run this flow periodically (automatically) or run it manually by clicking Test button.

That’s all for now. Let me know if you have any tips you would like to share.

🍉 Try this step-by-step getting started tutorial: Build Your First Automation With Okta Workflows: Notify When User Is Suspended.

Top comments (0)