# Set up workflows Learn how to set up workflows in the Dashboard. Create a workflow to set up an automated task in response to events in the Dashboard. ## Before you begin - You can run up to 50 active workflows at a time. - Create a [sandbox](https://docs.stripe.com/sandboxes.md) to test creating and running workflows. This allows you to experiment with new features, troubleshoot, and fix issues without impacting any live operations. - If you haven’t already, review [Workflows](https://docs.stripe.com/workflows/define-workflows.md). ## Create a workflow 1. Go to [Workflows](https://dashboard.stripe.com/workflows) in the Dashboard. 1. Click **New workflow** to open the Workflow Editor. 1. Click **Untitled workflow**, and enter a name for the workflow. 1. Click **Add a trigger**. - Each workflow can only have one trigger. - A [trigger](https://docs.stripe.com/workflows/define-workflows.md#triggers) is any public Stripe API event you can use to start your workflow. - You can search, or choose from one of the suggested triggers. You can also browse by category to narrow down the options. 1. After you choose a trigger, you can further specify when you want your workflow to run by adding a [condition](https://docs.stripe.com/workflows/define-workflows.md#trigger-conditions). - List conditions evaluate up to 100 items. For example, When setting up conditions on a field containing a list of items, the workflow only evaluates the first 100 items to determine whether the condition is met. We don’t evaluate any items beyond the limit. - Your workflow only runs if the trigger conditions are true. 1. Click **Add a step**. You can select either an [action](https://docs.stripe.com/workflows/define-workflows.md#actions) or a [condition](https://docs.stripe.com/workflows/define-workflows.md#conditions). - Each workflow can support up to 12 steps. - Dynamic values are pulled from a specific step, which might become outdated if the object changes after that step runs or triggers an event. However, each action runs using the object’s current, most up-to-date version. 1. Next, configure the action by adding values to the parameters. You must fill in all required fields for the workflow to run. These properties are marked as **Required**. 1. Add additional steps as needed. 1. Click **Publish**. For example workflows you can create, see [Use-cases](https://docs.stripe.com/workflows/use-cases.md) ## Test a workflow After you save and activate your workflow, test your workflow. You need to test the trigger, trigger conditions (if applicable), and the sequential steps you applied. For example, to test a workflow that triggers whenever a new customer is created: 1. Create a [sandbox](https://docs.stripe.com/sandboxes.md) to test your workflow safely without affecting your live account. 1. Go to [Customers](https://dashboard.stripe.com/customers) in the Dashboard. 1. Click **+ New Customer**. 1. Enter the customer details, and verify the name starts with the customer’s first name (for example, “John”). 1. Click **Add Customer**. ## Observe a workflow After triggering the workflow, check its run details: 1. Go to [Workflows](https://dashboard.stripe.com/automations) in the Dashboard. 1. Click the applicable workflow. 1. Under **Recent runs**, view the most recent run entry that represents the test workflow you created and triggered. - If the workflow ran successfully, the status displays a **Succeeded** badge. - If the workflow failed, the status displays a **Failed** badge. 1. Click the run to see the details of each step run by the workflow. If you click a step, you can also click **Inspect in Workbench** to see developer-focused [Workbench](https://docs.stripe.com/workbench.md) logs generated from the actions taken in the workflow. - Workbench is available for trigger events, allowing you to navigate directly to the event tab in Workbench, and for actions where you can access the applicable request log. - This isn’t available for Workflows-specific steps such as sending emails or evaluating conditions including branching. 1. In the **Run history** view, click the overflow menu (⋯) > **Inspect resource** to explore a JSON view of the object that triggered the workflow using [Workbench](https://docs.stripe.com/workbench/overview.md#inspector). ### Failed workflows If the workflow fails: 1. In the **Run history** view, click the steps that failed to see the error message. 1. Use the error messages to fix the steps. You can also click **Inspect in Workbench** to see developer-focused [Workbench](https://docs.stripe.com/workbench.md) logs generated by the workflow. 1. Click **Retry run** to directly re-trigger the workflow using the same trigger data. - You can only retry runs on workflows that are [active](https://docs.stripe.com/workflows/define-workflows.md#active-versus-inactive-workflows). - You can rerun a workflow using its original event data for up to 30 days after the initial trigger was met. 1. Verify if the rerun successfully completes (if the rerun starts from the initial trigger and proceeds through all steps in the workflow). ![Workbench view using Workflows](https://b.stripecdn.com/docs-statics-srv/assets/workbench.d7d4401e2bd1fcd3e0884433acbf33a2.png) Workbench view using Workflows ## Deactivate a workflow You have the ability to activate, deactivate, or delete workflows. After you deactivate a workflow, Stripe considers it as inactive and it no longer responds to triggers. You can maintain up to 50 active workflows at a time and have a combined total of 50 active and inactive workflows. If you have 50 workflows, you can’t create another one. If you have 50 active workflows and want to activate a new one, you must first deactivate an existing active workflow. To deactivate a workflow: 1. Go to [Workflows](https://dashboard.stripe.com/automations), and select the applicable workflow. 1. Click **Deactivate**. If you want to reactivate the workflow, click **Activate**. ### Delete a workflow Deleting a workflow is permanent. After deletion, a workflow is unrecoverable. Double check before deleting any workflow. Consider deactivating instead of deleting if you’re unsure. To delete a workflow: 1. Go to [Workflows](https://dashboard.stripe.com/automations), and select the applicable workflow. 1. Next to **Deactivate**, click the overflow menu (⋯) > **Delete workflow**. 1. Click **Delete** in the modal. The workflow is now permanently deleted along with its run details. ## Optional: View past versions You can view all previously activated versions of a workflow directly in the Workflow Editor: 1. Open the workflow in the editor. 1. Click the version dropdown next to the workflow name. 1. Select any past version to view its complete configuration in the canvas. This allows you to see how a workflow was configured at any point in its history. This helps you understand changes or debugging issues with past runs. ## See also - [Workflows](https://docs.stripe.com/workflows/define-workflows.md) - [Use cases](https://docs.stripe.com/workflows/use-cases.md)