How to 'merge' optional paths?

Hello!

I have a workflow that enriches data in NocoDB from 2 sources. I got everything working well, except the last step, which is the final notification.

Basically, the 2 data sources are not equal; S1 is more important than S2.

A simplified version of the workflow looks like this:

The gist of it is; if enrichment from S1 fails, there’s no notification.

If it succeeds, there always is one, and includes some of the data from S1.

What I want to do but failed so far, is - if enrichment from S2 was also successful, I want to include data from both S1 and S2 in the notification. If it failed, I still want to send the notification, but only with S1 data.

Now I don’t mind if in the case where S1 succeeds and S2 fails, the notification contains empty values instead of the data; i.e. I don’t necessarily need to change the format.
But I do want the notification to only be sent once.

I have managed to include data form both simply by connecting them up, but then the notification was sent multiple times.
And trying to use the Merge component would force executions of the branches where it shouldn’t, and would probably also not work well in case one of the branches produces no output.

Am I missing something? Is this doable at all?
Maybe there are some synchronization primitives or global state that I’m just missing?

Hi @zblesk,

What I want to do but failed so far, is - if enrichment from S2 was also successful, I want to include data from both S1 and S2 in the notification. If it failed, I still want to send the notification, but only with S1 data.

In this case you probably want to use a sequential approach without using the Merge node. Do S1 first, then S2 and continue your workflow either way. Something like this. Before sending out the notification, try to read data from the nodes relevant for S1 and S2.

To prevent your workflow from stopping if any of your nodes does not return results, consider using the Always Output Data setting. This will prevent your workflow from stopping:

image

Hope this makes sense and helps!

1 Like