> ## Documentation Index
> Fetch the complete documentation index at: https://openops-f559c8bf.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Building Workflows

> How to use the OpenOps workflow editor to create new workflows

In many cases, you can apply optimizations by taking one of the pre-made [workflow templates](https://openops-f559c8bf.mintlify.site/workflow-management/workflow-templates.md), creating a workflow off of the template, and customizing it to your liking.

When there's no template to bootstrap from, you can create a new workflow from scratch.

To end up with a minimally usable workflow, you need to:

1. [Create a new workflow](#creating-a-new-workflow)
2. [Add a trigger](#adding-a-trigger)
3. [Add at least one action](#adding-an-action)
4. [Test the workflow](#testing-a-workflow)
5. [Publish the workflow](#publishing-a-workflow)

Every workflow is made of steps. There are **two types of workflow steps**: triggers and actions.

* A **trigger** is your workflow's first step. It defines how often your workflow executes. It may also represent an event that needs to occur for your workflow to kick off. A workflow always has exactly one trigger.
* **Actions** are all subsequent steps of your workflow that start executing once your workflow is activated by a trigger.

Below is an example of a workflow that is triggered on a schedule. The first node represents the schedule trigger, and all other nodes are actions:

![Workflow triggered on a schedule](https://mintcdn.com/openops-f559c8bf/Dq0j-Ls86aG9hAnF/images/workflow-trigger-schedule.png?fit=max\&auto=format\&n=Dq0j-Ls86aG9hAnF\&q=85\&s=f6dff0477b1da9440570774ec1e20f42)

In another example, here's a workflow that uses an update of a Jira Cloud issue as a trigger:

![Workflow triggered by a Jira Cloud issue update](https://mintcdn.com/openops-f559c8bf/Dq0j-Ls86aG9hAnF/images/workflow-trigger-jira.png?fit=max\&auto=format\&n=Dq0j-Ls86aG9hAnF\&q=85\&s=1d50fece905b94165980c339ed26f965)

## Creating a new workflow

To create a new empty workflow, go to the **Workflows** section in your OpenOps instance, and click **New Workflow** in the top right corner. What you'll see is the workflow editor, which initially looks like this:

![Empty workflow editor](https://mintcdn.com/openops-f559c8bf/Dq0j-Ls86aG9hAnF/images/workflow-editor-empty.png?fit=max\&auto=format\&n=Dq0j-Ls86aG9hAnF\&q=85\&s=6f20b3c0611eb1ea800bf00b31da7683)

Let's look around and see what controls the editor provides:

* In the top left corner, if you click the arrow next to the workflow name, *Untitled*, you get access to a menu that lets you **rename** the new workflow, **delete** it, or **move it to a folder** for better organization:

  ![Workflow editor controls](https://mintcdn.com/openops-f559c8bf/Dq0j-Ls86aG9hAnF/images/workflow-editor-controls.png?fit=max\&auto=format\&n=Dq0j-Ls86aG9hAnF\&q=85\&s=cf37edc507ce9f6e576b3e621d4b4afd)
* The icon to the left of the workflow folder and name is a switch that lets you **show or hide the sidebar**, which contains the main OpenOps navigation menu.
* To the right of the workflow name, you have several buttons: **Tree view**, **Version history**, **Run logs**, and **Notes**. Version history and run logs will be more relevant when you update or [troubleshoot](https://openops-f559c8bf.mintlify.site/workflow-management/investigate-workflow-run.md) your workflows later on. For now, you can use **Notes** to describe the intent of your workflow in detail or leave any other comments for future reference. You can also click **Tree view** to display an aside showing the compact structure of your workflow, including its trigger, all actions, as well as [conditions and branches](https://openops-f559c8bf.mintlify.site/workflow-management/conditional-branching.md):

  ![Tree view of a workflow](https://mintcdn.com/openops-f559c8bf/Dq0j-Ls86aG9hAnF/images/workflow-editor-tree-view.png?fit=max\&auto=format\&n=Dq0j-Ls86aG9hAnF\&q=85\&s=7d3cc676f98b7ce44800db91842646ef)

## Adding a trigger

When you create a new workflow, the editor creates an empty stub trigger. Click the trigger node to select a trigger group that works for you:

![Selecting a trigger group](https://mintcdn.com/openops-f559c8bf/Dq0j-Ls86aG9hAnF/images/workflow-editor-select-trigger-group.png?fit=max\&auto=format\&n=Dq0j-Ls86aG9hAnF\&q=85\&s=c070e952518bcbacb7169bf3f0ae2a2f)

After selecting a group, choose a specific trigger within that group:

![Selecting a trigger](https://mintcdn.com/openops-f559c8bf/Dq0j-Ls86aG9hAnF/images/workflow-editor-select-trigger.png?fit=max\&auto=format\&n=Dq0j-Ls86aG9hAnF\&q=85\&s=215326ba11bedaa51378ba2037e0b5eb)

OpenOps provides over 10 triggers divided into several groups:

* **Schedule**: *Every X minutes*, *Every hour*, *Every day*, *Every week*, *Every month*, *Cron expression*.
* **SFTP**: *New file*.
* **Webhook**: *Catch webhook*.
* **Slack**: *New message*, *New reaction*.
* **Jira Cloud**: *New issue*, *Updated issue*.
* **Monday.com**: *New item in board*, *Specific column value updated in board*.

Some triggers are used more often than others. For most of your scenarios, you will probably use one of the triggers in the **Schedule** group, setting your workflows to run at a predetermined interval. For details on schedule triggers, see [Scheduling](https://openops-f559c8bf.mintlify.site/workflow-management/scheduling.md).

After selecting a trigger, click the trigger node again to display a right-hand pane with the properties of the trigger. For example, here are the properties of the *Every day* trigger:

![Trigger properties](https://mintcdn.com/openops-f559c8bf/Dq0j-Ls86aG9hAnF/images/workflow-editor-trigger-properties.png?fit=max\&auto=format\&n=Dq0j-Ls86aG9hAnF\&q=85\&s=01ac7a550639fdad17e288f50d89b1b0)

You can choose a specific hour in a specific time zone and include weekends, or go with the reasonable defaults.

Properties will vary with each type of trigger. For example, if the trigger is a new issue in Jira Cloud, you can specify a search query using Jira's JQL query language.

## Adding an action

As soon as you've created a trigger, the next and all subsequent steps of your workflow will be actions. Click the **+** icon under the trigger, and a pop-up menu will display a list of available action categories. Clicking a category lets you select a specific action:

![Selecting an action](https://mintcdn.com/openops-f559c8bf/Dq0j-Ls86aG9hAnF/images/workflow-editor-select-action.png?fit=max\&auto=format\&n=Dq0j-Ls86aG9hAnF\&q=85\&s=df13089864312f1320d3d6f3181e546d)

OpenOps provides a total of [120+ actions](https://openops-f559c8bf.mintlify.site/workflow-management/actions.md). One way to make sense of them is to classify them by intent:

* To **get data** for your workflow to process, look at cloud provider integration actions like **AWS** or **Azure**, recommendation provider actions such as **Anodot** and **AWS Compute Optimizer**, or generic **HTTP** actions.
* To **control the execution of your workflow**, use actions grouped under **Condition** and **Split**, **Loop on items**, **Delay**, and **End Workflow**.
* To **process data obtained in previous steps**, use **Date, List, Math, and Text operations**, **Data mapper** for advanced transformations, and **Code** for transformations that you can't express with available no-code actions.
* To **request human intervention**, use **Approval** or **Slack**.
* To **make or request changes to cloud resources**, use cloud provider actions, IaC integration actions like **AWS CloudFormation** and **Terraform**, and the **GitHub** action.
* To **make updates in project management tools**, use **Jira Cloud** or **Monday.com** actions.
* To **save data and generate reports**, use **SMTP**, **SFTP**, **Storage**, and **OpenOps Tables** actions.

When you select an action, OpenOps adds it to the workflow graph and displays a right-hand pane with the properties of the action:

![Properties of an action](https://mintcdn.com/openops-f559c8bf/Dq0j-Ls86aG9hAnF/images/workflow-editor-action-properties.png?fit=max\&auto=format\&n=Dq0j-Ls86aG9hAnF\&q=85\&s=3d9937e027473df3e8bf39e91c343ebf)

The specific set of properties depends on the type of action. Here are a few general rules:

* Actions that get data from or send data to external resources will require you to define a **connection**. For example, for AWS-related actions, you'd need to specify your access key ID, secret access key, and the default region. For a Slack connection, you'd specify your Slack instance's redirect URL, your client ID, and your client secret. One connection can be reused across multiple actions, and the OpenOps UI provides a separate view to list all connections you have defined so far.
* Actions that process data obtained in previous steps will ask you to specify the input data. For details, see [Passing Data Between Workflow Steps](https://openops-f559c8bf.mintlify.site/workflow-management/passing-data.md).
* Every action has two toggles: **Continue on Failure**, which lets the current action fail and continues the workflow regardless, and **Retry on Failure**, which retries the current action up to four times before giving up.

## Testing a workflow

Underneath the properties pane, every action has a **Generate Sample Data** section and a **Test Step** button, which lets you test or retest the action in isolation. Sometimes, this button may be grayed out, like this:

![Test button grayed out](https://mintcdn.com/openops-f559c8bf/Dq0j-Ls86aG9hAnF/images/workflow-editor-action-test-fix-inputs.png?fit=max\&auto=format\&n=Dq0j-Ls86aG9hAnF\&q=85\&s=928d1fa936a19d9481a8c3c41cfe3ee8)

Your step will also have a yellow warning icon next to it. If this happens, make sure you have filled in every mandatory input field in the action's properties pane. You may need to scroll through the properties pane to see all required fields:

![Scrolling the properties pane to reveal mandatory input fields](https://mintcdn.com/openops-f559c8bf/Dq0j-Ls86aG9hAnF/images/workflow-editor-action-mandatory-fields.png?fit=max\&auto=format\&n=Dq0j-Ls86aG9hAnF\&q=85\&s=96013319d9781a71cade91b6e9c65568)

Once you've filled in all mandatory fields, the **Test Step** button becomes active. Click it to run the test and view the output generated by the action:

![Sample data generated for an Anodot integration action](https://mintcdn.com/openops-f559c8bf/Dq0j-Ls86aG9hAnF/images/workflow-editor-action-generate-sample-data.png?fit=max\&auto=format\&n=Dq0j-Ls86aG9hAnF\&q=85\&s=7e5358d2378ab5dc4294ded346edd129)

As soon as you have implemented all steps, including a trigger and actions, it's time to test your entire workflow. If all the steps of your workflow are complete, you can see the **Test Workflow** button at the top of the workflow editor, right above the trigger node:

![Testing the entire workflow](https://mintcdn.com/openops-f559c8bf/Dq0j-Ls86aG9hAnF/images/workflow-editor-test-workflow.png?fit=max\&auto=format\&n=Dq0j-Ls86aG9hAnF\&q=85\&s=1419bc0195df68c17b042368e08d6f35)

If some of the steps aren't complete, you'll see the **Complete *n* steps** button at the top of the workflow editor instead. Incomplete steps will also be marked with a yellow warning icon:

![Incomplete steps detected](https://mintcdn.com/openops-f559c8bf/Dq0j-Ls86aG9hAnF/images/workflow-editor-test-complete-steps.png?fit=max\&auto=format\&n=Dq0j-Ls86aG9hAnF\&q=85\&s=36e909dbbb514199c366b8a491f3c30c)

Click **Complete *n* steps** to navigate to the first incomplete step in your workflow. Locate the remaining incomplete steps by the yellow warning icons next to them.

As soon as you've made sure that all individual steps are complete, go back to the top of the workflow editor and press **Test Workflow**. After performing a test run of the workflow, OpenOps will show results of the run in the **Run Details** pane to the left of the editor, indicating the status of each step, as well as its inputs and outputs:

![Run details after testing the entire workflow](https://mintcdn.com/openops-f559c8bf/Dq0j-Ls86aG9hAnF/images/workflow-editor-run-details.png?fit=max\&auto=format\&n=Dq0j-Ls86aG9hAnF\&q=85\&s=0c9bb945708f4e01715c09ddeaeae688)

## Publishing a workflow

When you're happy with your workflow and want to start running it, click **Publish** in the top right corner.

This also applies when you're editing an existing workflow: to avoid disrupting pending workflow runs, your changes won't take effect until you publish them.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.