# Set up workflows

Learn how to set up workflows in the Dashboard.

Create a workflow to automate a task. You can trigger workflows with Stripe events or invoke them programmatically.

## 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.
- Make sure you understand [how Workflows work](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 builder.
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 also select a [programmatic trigger](https://docs.stripe.com/workflows/programmatic-triggers.md) to start the workflow manually or through the API.
   - Select one of the suggested triggers. You can search or browse by category.
1. After you choose a trigger, 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), a [condition](https://docs.stripe.com/workflows/define-workflows.md#conditions), or a [loop](https://docs.stripe.com/workflows/loops.md).
   - 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**.

### Select an event source (Connect platforms)

If you’re a Connect platform, you see an additional option when configuring your trigger: **Monitor trigger on**. This controls which account’s events trigger the workflow.

- **Your account**: The workflow triggers on events from your platform account (default).
- **Connected account**: The workflow triggers on events from any of your connected accounts.

Select the event source that matches your use case. You can’t select both. A workflow monitors one event source.

You can also configure individual actions to run against the connected account or your platform account. See [Actions on connected accounts](https://docs.stripe.com/workflows/define-workflows.md#actions-on-connected-accounts) for details.

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**.

### Test with connected accounts

To test a workflow that triggers on connected account events:

1. Use a Sandbox environment with at least one connected account.
1. Create or simulate an event on the connected account that matches your trigger. For example, if your workflow triggers on `payment_intent.succeeded`, create a test payment on a connected account.
1. Verify the workflow run appears in **Run history**. The run details show which connected account triggered the run.

If you don’t have connected accounts in your Sandbox, create test connected accounts first. See [Test Connect integrations](https://docs.stripe.com/connect/testing.md) for guidance.

> Actions that operate on connected accounts might fail if the account lacks the required permissions. Check run details to diagnose permission errors.

## Observe a workflow

After triggering the workflow, check its run details:

1. Go to [Workflows](https://dashboard.stripe.com/workflows) 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. After fixing the issue, create a new workflow run to verify the fix.
![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. 1. Go to [Workflows](https://dashboard.stripe.com/workflows), 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/workflows), 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)

- [Loop over collections](https://docs.stripe.com/workflows/loops.md)
- [Create custom actions](https://docs.stripe.com/workflows/custom-actions.md)
- [Trigger workflows programmatically](https://docs.stripe.com/workflows/programmatic-triggers.md)
