Okta Workflows How-To: Six Ways to Trigger a Flow

Okta Workflows is a no-code platform for automating identity processes. 

This blog post is based on a question asked during office hours or the #okta-workflows channel in MacAdmins Slack: How do you trigger a flow?

Getting started

There are six ways to trigger a flow. They are

  • Schedule (flow runs periodically)
  • Event (flow is called when a particular event is fired)
  • Manual (clicking the Test button)
  • API endpoint (another system invokes a flow via an API endpoint)
  • Helper flow (flow calling another flow)
  • Delegated flow (let someone else in your organization invoke it)

Schedule (flow runs periodically)

A flow can be scheduled to run periodically. For example, you can schedule a flow to run every hour, every day, or once a week (there are other options also).

To schedule a flow, add the Schedule event:

workflows howto runflow addeventEvents to trigger a flow

To configure the schedule, click the 🕔 at the bottom of the card:

workflows howto runflow schedule2A flow that runs on schedule

Options to configure when to run a flow:

workflows howto runflow schedule1Flow schedule options

Event (flow is called when a particular event is fired)

Another way to trigger a flow is when a specific event occurs in an organization. For example, this flow will run when a user is added to a group:

workflows howto runflow useraddedgroupTrigger a flow when a user is added to a group

Every connector supports different events:

workflows howto runflow connector eventsEvents available from the Okta connector

Manual (clicking the Test button)

If you have a flow that needs to run manually, infrequently, or just once, use the Test button to trigger a flow. Even though it says Test, it’s a perfectly fine way to run a flow.

workflows howto runflow test buttonRunning a flow via the Test button

When manually running a flow, you don’t need to have an event card set (1st card).

As an API endpoint (another system invokes a flow via an API endpoint)

It is possible to trigger a flow from an external system via an API endpoint. For example, an event occurs in an external system, which calls to an API endpoint that triggers a flow.

To trigger a flow via an API endpoint, use the API Endpoint event card:

workflows howto runflow api1Triggered a flow via an API endpoint

The API endpoint information is available by clicking the </> icon at the bottom of the card.

workflows howto runflow api2API endpoint settings

To test an API endpoint, use a service such as Postman.

Helper flow (flow calling another flow)

A helper flow is a flow called from another flow. A helper flow is usually used when there is a list of objects (users, groups, etc.), and you need to iterate over each item in a list to perform an action.

In this example, a flow named Check last login will be called for each user found via List Users with Search card:

workflows howto runflow mainflow 1Calling a helper flow

Helper flow is called for each item in a list:

workflows howto runflow helperflowHelper flow

A flow becomes a helper flow when using On Demand – Helper Flow event card:

workflows howto runflow addeventFlow trigger event cards

Flow chart view of the main flow and helper flow:

workflows howto runflow flowchart helper2Main flow and helper flow

Delegated Flow (let someone else in your organization invoke it)

Delegated Flow is when you delegate to another user to run a flow. That person might not be an administrator but needs to be able to trigger a particular flow.

To make a delegated flow, add Delegated Flow event card:

Note: as of this writing Delegated Flow is an Early Access feature.

workflows howto runflow addeventDelegated flow event card

A delegated flow event card can define one or more inputs. In the screenshot below, the flow has two inputs: Name and ID.

workflows howto runflow delegated1Delegated flow

Flow execution is delegated to another user within an organization. In the screenshot below, the user stella.green can run this flow:

workflows howto runflow delegated3 1A flow delegated to a user to run

When Stella invokes the flow, Stella will need to enter flow inputs:

workflows howto runflow delegated4Delegated flow inputs

Looking at the flow history after Stella triggered the flow:

workflows howto runflow delegated2Delegated flow history

In this How-To Guide, you learned six different ways to trigger flow.

Get your Workflows questions answered

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

 

Tags

Workflows