make a non IEnumeator function Wait for a coroutine to finish?

I am trying to implement behaviour trees in untiy and right now i am using a Tick() function for each Node/Composite/Action
What I want to do :

  1. Begin the for loop itereating in the list of nodes
  2. Start the tick function on the current node
  3. Wait until the node tick returned Failed/Success
  4. Go to the next node and continue to go to step 1

What i want to do is in a sequence for example, pause the execution of the execute function (line 29) until the node
has reached a Failed/Success Status. I am trying to acomplish this using a coroutine

IEnumerator Recursive(Node nod)
{
    while (true)
    {
        Debug.Log(nod + "is running");
        Status status = nod.Tick();

        Debug.Log(Time.time + " " + status);
        if (status == Status.Running)
        {
            Debug.Log("start coroutine at : " + Time.time);
            yield return new WaitForSeconds(0.2f);
            Debug.Log("Comtinue coroutine at : " + Time.time);
        }
        else
        {

            Debug.Log("has finished coroutine");
            nodeStat = status;
            break;
        }
    }
}
protected override Status Execute()
{
    foreach(Node nod in ListaNoduri)
    {
        GameManager.Instance.StartCoroutine(Recursive(nod));
        Debug.Assert(nodeStat != Status.None);
        if (nodeStat == Status.Failure)
            return Status.Failure;
    }
    return Status.Success;
}

the problem is that the assertion is true, the nodeStat var is None because the coroutine does not finish

Hey!
Can’t you just add a bool hasFinished, and set that to true when the coroutine reaches an outcome. Then add an if(hasFinished) { hasFinished = false; // Run code } to the code you want to run only when the coroutine has finished?