- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.5k
Parallel beta docs #14445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Parallel beta docs #14445
Changes from all commits
      Commits
    
    
            Show all changes
          
          
            3 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      
    File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
        
          
          Binary file added
          
            BIN
              
                +1.54 MB
              
          
        
  docs-v2/pages/workflows/control-flow/images/parallel/02_add_parallel.gif
  
  
      
      
   
        
      
      
    
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
        
          
          Binary file added
          
            BIN
              
                +948 KB
              
          
        
  docs-v2/pages/workflows/control-flow/images/parallel/03_configure_and_test.gif
  
  
      
      
   
        
      
      
    
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
        
          
          Binary file added
          
            BIN
              
                +6.26 MB
              
          
        
  docs-v2/pages/workflows/control-flow/images/parallel/04_add_steps.gif
  
  
      
      
   
        
      
      
    
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
        
          
          Binary file added
          
            BIN
              
                +1.27 MB
              
          
        
  docs-v2/pages/workflows/control-flow/images/parallel/05_test_end_phase.gif
  
  
      
      
   
        
      
      
    
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
        
          
          Binary file added
          
            BIN
              
                +2.17 MB
              
          
        
  .../pages/workflows/control-flow/images/parallel/06_use_exports_in_parent_flow.gif
  
  
      
      
   
        
      
      
    
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
        
          
          Binary file added
          
            BIN
              
                +1.64 MB
              
          
        
  docs-v2/pages/workflows/control-flow/images/parallel/07_deploy_and_run.gif
  
  
      
      
   
        
      
      
    
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
        
          
          Binary file added
          
            BIN
              
                +65.1 KB
              
          
        
  docs-v2/pages/workflows/control-flow/images/parallel/add_parallel_block.png
  
  
      
      
   
        
      
      
    
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
        
          
          Binary file added
          
            BIN
              
                +75.3 KB
              
          
        
  docs-v2/pages/workflows/control-flow/images/parallel/rename_branch.png
  
  
      
      
   
        
      
      
    
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| import Callout from '@/components/Callout' | ||
| import VideoPlayer from "@/components/VideoPlayer"; | ||
| import { Steps } from 'nextra/components' | ||
|  | ||
| # Parallel | ||
|  | ||
| ## Overview | ||
|  | ||
| **Parallel** is multi-path branching operator. It allows you to create multiple execution branches with optional filtering rules and Pipedream will execute **all** matching branches. Unlike [Switch](./switch) and [If/Else](./ifelse), the order in which rules are defined will not affect the path of execution. | ||
|  | ||
|  | ||
|  | ||
| ## Capabilities | ||
|  | ||
| - Create non-linear workflows that execute steps in parallel branches | ||
| - Define when branches run — always, conditionally or never (to disable a branch) | ||
| - Merge and continue execution in the parent flow after the branching operation | ||
|  | ||
| <Callout type="info"> | ||
| The Parallel operator is a control flow **Block** with **start** and **end** phases. [Learn more about Blocks](./#blocks). | ||
| </Callout> | ||
|  | ||
| ### Add Parallel operator to workflow | ||
|  | ||
| Select **Parallel** from the **Control Flow** section of the step selector: | ||
|  | ||
|  | ||
|  | ||
| ### Create Branches | ||
|  | ||
| To create new branches, click the `+` button: | ||
|  | ||
|  | ||
|  | ||
| ### Rename Branches | ||
|  | ||
| Edit the branch's nameslug on the canvas or in the right pane after selecting the **Start** phase of the parallel block. The nameslug communicates the branch's purpose and affects workflow execution—the end phase exports an object, with each key corresponding to a branch name. | ||
|  | ||
|  | ||
|  | ||
| ### Export Data to the Parent Flow | ||
|  | ||
| You can export data from a parallel operation and continue execution in the parent flow. | ||
| - The parallel block exports data as a JSON object | ||
| - Branch exports are assigned to a key corresponding to the branch name slug (in the object exported from the block) | ||
| - Only the exports from the last step of each executed branch are included in the parallel block's return value | ||
| - To preview the exported data, test the **End** phase of the parallel block | ||
|  | ||
| ### Beta Limitations | ||
|  | ||
| Workflow queue settings (concurrency, execution rate) may not work as expected with workflows using the parallel operator. | ||
|  | ||
| ## Getting Started | ||
|  | ||
| <Steps> | ||
|  | ||
| ### Generate a test event | ||
|  | ||
| Add a trigger and generate an event to help you build and test your workflow: | ||
|  | ||
|  | ||
|  | ||
| ### Add the Parallel control flow block | ||
|  | ||
| Click the + button to add a step to the canvas and select Parallel from the Control Flow section on the right. You can optionally add or remove branches and configure conditions defining when each branch should run. | ||
|  | ||
|  | ||
|  | ||
| ### Test to identify the execution path(s) | ||
|  | ||
| Test the **Start** phase to identify which branches will execute for the current event. | ||
|  | ||
|  | ||
|  | ||
| ### Add steps to branches | ||
|  | ||
| Add steps to the branches. These steps will be executed in parallel when the workflow runs. | ||
|  | ||
|  | ||
|  | ||
| ### Optionally merge and continue to the parent flow | ||
|  | ||
| Test the **End** phase to export the results of the last step of each branch that was executed. This makes data from the branches available to reference in the parent flow. | ||
|  | ||
|  | ||
|  | ||
| ### Use exports in parent flow | ||
|  | ||
| Optionally add steps after the parallel block and use data from individual branches by referencing the return value of the **End** phase. | ||
|  | ||
|  | ||
|  | ||
| ### Deploy and test the live workflow | ||
|  | ||
| Deploy the workflow and trigger it to inspect the executions. | ||
|  | ||
|  | ||
|  | ||
| </Steps> | ||
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add a code example for data exports.
Consider adding a simple code example showing the structure of exported data to help users better understand how the data is organized.