Hello
We cannot get an output from inside of an execute activity, so you cannot get the activity status value to decide whether to execute foreach
Instead, I would recommend, using a stored procedure as the last activity in the pipeline for both Execute pipeline activities which will store the status value as success against the pipeline run id in a log kind of table if the pipeline executed till the last activity
Then in the lookup you can lookup on that log table as well to get the success status against a pipeline run id which you can get from execute pipeline
In this case you will not have to link both activities to the lookup, any one can be linked but lookup will run for both execute activities based on log table result
This seems to be clumsy but I don't think there's a direct way out in a general ADF pipeline
Thank you