How to Run One Trigger with Two Parallel Steps?

This topic was automatically generated from Slack. You can find the original thread here.

How run one trigger-two parallel steps?

To run two parallel steps after a single trigger in a Pipedream workflow, you can simply add both steps right after the trigger. Pipedream will execute these steps concurrently by default. There’s no need to configure concurrency settings for this case, as parallel execution is the default behavior.

Show me example.

Here’s an example of a Pipedream workflow with a trigger and two parallel steps: 1. Add an HTTP trigger to your workflow. 2. Add a new action or code step right after the trigger (let’s call it Step A). 3. Add another action or code step right after the trigger (let’s call it Step B). Now, when the workflow is triggered, both Step A and Step B will run concurrently. Here’s a simple example using code steps: 1. Add an HTTP trigger. 2. Add a code step (Step A) with the following code: console.log("Running Step A"); 3. Add another code step (Step B) with the following code: ```
console.log(“Running Step B”);

: If we do this, Step A and Step B will run sequentially, not concurrently.

Apologies for the confusion earlier. You’re correct that the steps I mentioned would run sequentially. In Pipedream, steps within a single workflow run sequentially by default. To achieve parallel execution, you can use separate workflows for Step A and Step B, and trigger them using an HTTP request or another method. This way, both workflows will run concurrently when triggered.

Basically, Pipedream doesn’t really support parallelism right now.

It’s easy to fan out, but much more tricky to fan back in. It would require using the data store to validate that all the parallel workflows have completed before continuing.

At the end of each parallel workflow, a check would need to be added to see if all the other workflows have completed, and then the resume_url for the main workflow could be triggered.