|
| 1 | +import Callout from '@/components/Callout' |
| 2 | +import VideoPlayer from "@/components/VideoPlayer"; |
| 3 | +import { Steps } from 'nextra/components' |
| 4 | + |
| 5 | +# Parallel |
| 6 | + |
| 7 | +## Overview |
| 8 | + |
| 9 | +**Parallel** is multi-path branching operator. You can create multiple execution branches with optional filtering rule and Pipedream will execute **all** matching branches. Unlike `Switch` and `If/Else`, the order in which rules are defined will not affect the path of execution. |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +## Capabilities |
| 14 | + |
| 15 | +- Create non-linear workflows that execute steps in parallel |
| 16 | +- Define multiple branches with optional filters (every branch runs by default) |
| 17 | +- Merge and continue execution in the parent flow after the branching operation |
| 18 | + |
| 19 | +<Callout type="info"> |
| 20 | +The Parallel operator is a control flow **Block** with **start** and **end** phases. [Learn more about Blocks](./#blocks). |
| 21 | +</Callout> |
| 22 | + |
| 23 | +## Getting Started |
| 24 | + |
| 25 | +<Steps> |
| 26 | + |
| 27 | +### Generate a test event |
| 28 | + |
| 29 | +Add a trigger and generate an event to help you build and test your workflow: |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | +### Add the Switch control flow block |
| 34 | + |
| 35 | +Click the + button to add a step to the canvas and select Switch from the Control Flow section on the right. In the “start” phase, configure rules for a case. |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +<Callout type="info"> |
| 40 | +**IMPORTANT:** If you disable the **Default** condition and an event does not match any of the rules, the workflow will continue to the next step after the **Switch** section. If you want to end workflow execution if no other conditions evaluate to `true`, enable the Default condition and add a **Terminate Workflow** action. |
| 41 | +</Callout> |
| 42 | + |
| 43 | +### Optionally add additional cases |
| 44 | + |
| 45 | +To add additional cases, click the **+** button. |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | +### Test and build along the execution path |
| 50 | + |
| 51 | +Test the **start** phase and add a step to the branch in the execution path, |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +### Optionally merge and continue the parent flow |
| 56 | + |
| 57 | +Test the **end** phase to export the results of the last step in the execution path. This makes them available to reference in the parent flow. |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +### Scaffold alternate paths |
| 62 | + |
| 63 | +You may add steps to alternate paths and test them. Pipedream will signal that the results may not be reliable if the branch is not in the execution path. |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | +### Validate alternate paths |
| 68 | + |
| 69 | +Generate or select alternate events to trigger and validate alternate paths. |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | +### Deploy and test the live workflow |
| 74 | + |
| 75 | +Deploy the workflow and trigger it to inspect the executions. |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | +</Steps> |
0 commit comments