Workflows Tips #7 – Variables, Repeatable Flows, and Batch Create from CSV File
Tags: nocode, okta, oktaworkflows, automation
Published: 2022-08-18 20:10:29

---
title: Workflows Tips #7 – Variables, Repeatable Flows, and Batch Create from CSV File
published: true
date: 2022-08-18 04:34:35 UTC
tags: nocode, okta, oktaworkflows, automation
canonical_url: https://maxkatz.net/2022/02/09/workflows-tips-7-variables-repeatable-flows-and-batch-create-from-csv-file/

---

Welcome to another Okta Workflows Tips post. [Read](https://dev.to/oktaworkflows/okta-workflows-tips-57bj) all other tips.

> These tips are coming from Workflows community member [Jeff Lai](https://www.linkedin.com/in/jefflaiau/). Jeff enjoys helping with Workflows questions on the [MacAdmins Slack channel](https://www.macadmins.org). Jeff is the team lead for System Operations at Canva. If you’d like to work with him, he’s [hiring for a role](https://www.canva.com/careers/jobs/sydney-new-south-whales-australia-it-automation-engineer/) in this space!

In this post:

- Use Construct card to create flow variables
- Repeatable flow for ad-hoc processes
- Batch create users from a CSV file

## Use Construct card to create static flow variables

Set up a **Construct** card at the start of your flow, and use that to hold your variables. Makes it easier to track whatever that magic value is when you’re coming back to a flow later, and as well for helping other people that you’re working with. Also makes it really easy to set up template-like flows that you can reuse, and just changing the values of the static variables.

[![Setting up flow variables with Construct card](https://katzmax.files.wordpress.com/2022/02/workflows_tips_construct1.png?w=1024)](https://katzmax.files.wordpress.com/2022/02/workflows_tips_construct1.png)
<figcaption>Setting up flow variables with Construct card</figcaption>

With the variables defined they can be used anywhere in the flow with other cards.

## Repeatable flow for ad-hoc processes

Set up a helper flow with blank but specific inputs that go into the rest of the flow. Now you have a repeatable flow for ad-hoc processes that you can manually invoke. Let’s say you need a flow to send an email that you want to run when needed. A flow might look like this (note that the first card is a **Helper Flow** card with inputs):

[![A flow that can be invoked manually](https://katzmax.files.wordpress.com/2022/02/workflows_tip_adhoc_flow1.png?w=1024)](https://katzmax.files.wordpress.com/2022/02/workflows_tip_adhoc_flow1.png)
<figcaption>A flow that can be invoked manually</figcaption>

[![Running a flow](https://katzmax.files.wordpress.com/2022/02/workflows_tips_adhoc_test.png?w=1024)](https://katzmax.files.wordpress.com/2022/02/workflows_tips_adhoc_test.png)
<figcaption>Running a flow</figcaption>

## Batch create users from a CSV file

If you need to batch create users or batch add people go a group, use the **Table – Import from CSV** card to import data into a table then iterate through the rows: create a user and then delete the row. As with the previous tip, this flow (and its helper flow) can be triggered manually when needed.

The main flow looks like this:

[![Load data from CSV file into a table](https://katzmax.files.wordpress.com/2022/02/workflows_tips_batch_main.png?w=1024)](https://katzmax.files.wordpress.com/2022/02/workflows_tips_batch_main.png)
<figcaption>Load data from CSV file into a table</figcaption>

[![Helper flow to iterate over table data to create a new user](https://katzmax.files.wordpress.com/2022/02/workflows_tips_batch_helper2.png?w=1024)](https://katzmax.files.wordpress.com/2022/02/workflows_tips_batch_helper2.png)
<figcaption>Helper flow to iterate over table data to create a new user</figcaption>

Alternatively, instead of setting up a flow to import a CSV file you can import it directly from the table page:

[![Import CSV file from table page](https://katzmax.files.wordpress.com/2022/02/workflows_tips_import_table.png?w=1024)](https://katzmax.files.wordpress.com/2022/02/workflows_tips_import_table.png)
<figcaption>Import CSV file from table page</figcaption>

Using this approach your main flow will only have two cards now:

[![Using data from a table to create users(https://katzmax.files.wordpress.com/2022/02/workflows_tips_batch_short.png?w=984)](https://katzmax.files.wordpress.com/2022/02/workflows_tips_batch_short.png)
<figcaption>Using data from a table to create users</figcaption>

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

Thank you again to [Jeff Lai](https://www.linkedin.com/in/jefflaiau/) for providing these helpful tips.

🍉 Try this step-by-step getting started tutorial: [Build Your First Automation With Okta Workflows: Notify When User Is Suspended](https://dev.to/maxkatz/build-your-first-automation-with-okta-workflows-notify-when-user-is-suspended-1l3p-temp-slug-2933517).