PipedreamHQ / pipedream

Connect APIs, remarkably fast. Free for developers.
https://pipedream.com
Other
8.32k stars 5.27k forks source link

Support for branching (if / then) operation #216

Open dylburger opened 4 years ago

dylburger commented 4 years ago

Currently, workflows are a linear sequence of steps. I'd like support to branch a workflow in a conditional manner (if condition is true, run this step, else run this other step).

dylburger commented 4 years ago

One comment from Slack: "what id love to see is some kind of support of metadata in steps that's a simple condition, like: Condition: [ ] where you enter a value that gets evaluated at runtime. if true, the step executes. you then enter something like "steps.jira_ticket.assignee === 'jim'""

rugbbyli commented 2 years ago

Hello, are there any updates for this feature ? @dylburger

dylburger commented 2 years ago

@rugbbyli not yet but we’re still actively thinking about it

ThinkFar commented 2 years ago

@dylburger, I would love to see this. This is one of my biggest pain points with pipedream.

kpetrillo commented 2 years ago

Off the top of my head, this is my only request that would make my life so much easiest. Pipedream is a solid product but having conditional steps would be a game changer!

essential-randomness commented 2 years ago

Would it be possible to have some sort of "goto step #X if condition is true" block? I don't know how complex that would be to implement, but it seems in line with what other steps can do.

dylburger commented 2 years ago

@essential-randomness That's great feedback and yes, this would be possible with the implementation we envision for this.

giondo commented 2 years ago

no update yet? I would be great to have conditionals steps so we can perform different actions with diff integrations depending on the trigger

dylburger commented 2 years ago

@giondo No update on this yet, but it's near the top of our backlog after we finish #220 (currently our #1 most-requested feature).

EnGlamdring commented 2 years ago

@dylburger +1 I'm doing multiple flows right now to handle this and it's driving me nuts. Thanks!

devang-kredx commented 2 years ago

I'd like to keep logic of different branches of a workflow separated and clean so that it's easier to track and debug (rather than managing branching in the code itself and then having if-else statement in every subsequent block)

jonparker commented 2 years ago

We would love this feature.

Even the ability to have a simple condition to skip a step.

We have some workflows that have 3 or 4 Slack steps but we aren't able to support proper testing which would require having the workflow use a test Slack account.

Currently the only way to do it is to either have two copies of the one workflow or duplicate and convert all the Slack steps into code steps and then have an if statement around each code block to only run it if the test flag is true for the test steps and false for the live steps.

I guess an alternative would be some kind of condition which determines which account to use for the auths object.

This would mean allowing multiple Slack accounts to be connected to a single step.

LucBerge commented 1 year ago

I guess an alternative would be some kind of condition which determines which account to use for the auths object. This would mean allowing multiple Slack accounts to be connected to a single step.

@jonparker Great idea but from my point of view, this is indenpendent from this issue. You want the apps account props to be seen as pointers to an account. You could then change the pointer in the previous steps so that Slack account A or B is used to send a message.

When this issue will be closed, you can do a simple if condition with identical slack actions on each branch but different accounts.

For now, I recommend you to open a new issue.

jonparker commented 1 year ago

Hi @LucBerge , I am no longer using Pipedream in that team. I am only using it for small personal projects.

yangcheng commented 1 year ago

is there any update on this feature?

modernmusician commented 1 year ago

very important feature!

the "Router" module in Integromat / Make is a great reference.

one way you could improve on it is by adding sequencing to the router steps so it can either complete the branches sequentially, or you could do it synchronously

myonara commented 1 year ago

Very Essential is also branching on an error from the previous step. So I can use more standards block instead of coding the error handling in each step individually in node.js or other languages. Thanks for considering.

b2storefront commented 1 year ago

Very much waiting for this feature to be implemented, upvoting! :)

elibroftw commented 1 year ago

Kinda of thinking of replacing pipedream now with my website because of this. I keep getting errors because the source was accessed via a GET request and not POST so my parsing step returns nothing to my Discord webhook step.

yangcheng commented 1 year ago

agree, . If I have to write code instead of releasing the power to non-engineers, I'd go with lambda or cloudflare workers, way cheaper.

s1248 commented 1 year ago

I think this is an extremely important feature. And now this is also my pain point when using Pipedream. Currently I'm working on using Microsoft Power Automate. To set conditions and switch each case will send requests to each flow separately in Pipedream. However, the trade-off is a 1s delay for each trigger. It would be great if Pipedream adds this feature soon to compete with Microsoft Power Automate.

image

bacherjo commented 1 year ago

Hi Pipedream, why is branching still not there? This thread dates back to mid 2021, when you were "actively thinking about it". We need a bit more speed in feature delivery. For the other feature I am waiting for (loop over an array) https://github.com/PipedreamHQ/pipedream/issues/193#issuecomment-1303208624 it is now three years with no progress.

rrbbtalnorth commented 1 year ago

Hi, I also agree with the request to add "router" to the workflow. We will be happy to receive updates.

chahalamol commented 1 year ago

also wondering on the status of this feature

fev4 commented 1 year ago

Is the alternative to use other workflows? Like, the work starts on one workflow and depending on what happens sends the information to another workflow, and so it starts to branch out. I'm gonna give that a try, but it seems difficult to visualize.

acreconsulting commented 1 year ago

+1 following

tonyxiao commented 1 year ago

It would also be great if the branches can be executed in parallel as well.

wwc-development commented 1 year ago

Is this an upcoming feature? This would be really helpful

drakeballew commented 1 year ago

+1 to this feature - would love to see it. While it does seem like there is some pretty incredible stuff that can be done by chaining workflows together as well, just not sure the UX is there to make this feature irrelevant.

yangcheng commented 1 year ago

has been more than 3 years and no update, I am moving all my pipedream workflow to cloudflare workers.

dylburger commented 1 year ago

Hi @yangcheng , this is still on our roadmap. Does Cloudflare workers support branching logic in their function UI?

yangcheng commented 1 year ago

No, but I just ask gpt to write code for me. So no need for functional UI anymore.

Zewb commented 11 months ago

I saw it mentioned in Slack, but looks like this is still in-progress with no ETA. Looks like it would be a great addition when it happens though!

drakeballew commented 11 months ago

Agreed! Meanwhile, I’ve found that you can do this and a lot more by handling the branching yourself in a custom code block if you break up your larger workflow into sub component workflows and then use HTTP requests to trigger the sub flows. I can share an example of what I’m doing if it would be helpful, lmk.

On Thu, Jun 8, 2023 at 12:17 AM, Zewb @.***(mailto:On Thu, Jun 8, 2023 at 12:17 AM, Zewb < wrote:

I saw it mentioned in Slack, but looks like this is still in-progress with no ETA. Looks like it would be a great addition when it happens though!

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

mahomedh commented 11 months ago

Agreed! Meanwhile, I’ve found that you can do this and a lot more by handling the branching yourself in a custom code block if you break up your larger workflow into sub component workflows and then use HTTP requests to trigger the sub flows. I can share an example of what I’m doing if it would be helpful, lmk.

If you could share, this would be great. Though I assume that creating multiple flows to handle branching will count towards the active workflows. So this is limited for anyone not on the Advanced price plan. I was loving pipedream in my tests so far, but this might be a deal breaker.

VladymyrPylypchatin commented 11 months ago

+1 for this feature. The only reason for considering make/integromat or a custom solution

Zewb commented 11 months ago

Yeah, that would definitely help! Please share anyone you've got. :)

VladymyrPylypchatin commented 11 months ago

In the meantime, here're a few handy workarounds that helped me avoid the need for if/else. Maybe it would be helpful for someone.

  1. Custom actions "find or add."

    Screenshot 2023-06-11 at 08 05 46
  2. Mapping of the actions

    Screenshot 2023-06-11 at 08 07 47
drakeballew commented 11 months ago

Here's an example of chaining together workflows using HTTP responses as triggers. You can use custom code blocks to do the logic branching. I removed some steps with the special sauce so unfortunately this code won't run out of the box, but it should give you an idea of how you can branch things out logically. Let me know if you have questions!

------- Original Message ------- On Saturday, June 10th, 2023 at 11:09 PM, Vova Pilipchatin @.***> wrote:

In the meantime, here're a few handy workarounds that helped me avoid the need for if/else. Maybe it would be helpful for someone.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

bacherjo commented 11 months ago

all the posted suggestiosn for branching via code steps are valid and OK, but I think what is missing big time is "conditional step execution". I would most love to have this as generic option in any http request step. It could be "true" by default, so nothing changes for existing flows. And then just have a condition to define (using properties of previous steps) and based on truo or false execute the step or skip it.

My practrical use case: I receive an order and then have to check if the customer record already exists. If not, create customer, then create order. If yes, just create the order for existing customer. This would be so simple with a "conditional execution" option.

Since we do not have it, I had to build a "router" workflow, which searches for the customer and then conditionally branches (via codestep) to two other workflows, one with customer and order creation, one with just order creation. So for this simple requirement i end up having three workflows, and a tedious coding step.

HardIsEasy commented 8 months ago

+1 I just came from Make.com where router is very easy to set up makes pipedream look way to complicated

mroy-seedbox commented 4 months ago

Another type of branching to consider: run two (or more) branches in parallel (fan out), and then with the ability to fan back in later.

Something that could support a workflow like this:

    ----- A1 ------- A2 ------- A3 ------- A4
          |          |          |
          B1 ------- B2         |
          |                     |
          C1 ------- C2 ------- C3
                     |
                     D1
expozeur commented 4 months ago

How is it possible that something so simple, like the ability for custom logic to skip a certain step based on a condition, is not built in to an integrations tool that is intending to compete with the big guys like Zapier and Make? I'm a new Pipedream evangelist, but this is just disappointing. And then to see that this is an ongoing conversation and that there have been plans to "fix" this for 4 years is just embarrassing.

We all look forward to a solution.

dylburger commented 4 months ago

@expozeur we’re working on this now. This is a complex feature to get right. Try to be patient as we make it happen.