Workflows - Rejoin Branches after Compare Operator

Hi everyone!

I’m currently building a workflow where I use a Compare Strings operator to determine which HTTP Request I need to make. Following either of the HTTP requests, the rest of the workflow is identical, regardless of the difference between the strings originally compared. However, I can’t seem to figure out how to bring my paths back together. Any actions that follow the two different HTTP requests can only use the variables from one or the other. How do I avoid duplicating my logic flow on two paths for the duration of the workflow?

In the example image above, Form 1 can use the response from HTTP Request {{$.hTTPRequest.body}}, or from HTTP Request 1 {{$.hTTPRequest1.body}}.

Any insights would be appreciated!

Thanks

Hi @MattUribe,

After each HTTP request you can Define the Variable for retriving the body by using the same variable name.

At your workflow runtime only variable will filled at time.

Thanks for the response. I’ve done something like what you described, using an expression in the JSON path so that I only need a single Define Variable.

Using the Advanced editor for the Define Variable operator, I was able to assign the value for either path.

image

Thanks

@MattUribe do you test it ?

Yes. The variable is assigned the correct value regardless of the path the workflow takes to get there.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.