Combining a background command with setting a variable

I would like to start a process in the background, using the background command, but I would also like to set the output into a variable to use in another run command.

Is the following possible?

  - run:
      name: Run application
      command: |
        run_output=$(node run)
        echo "export run_output=$run_output" >> $BASH_ENV

In the example, node run starts and runs the application.

I have tried the above, however an echo $run_output from my next run command, returns an empty string.

  - run:
      name: check variable
      command: |
        echo $run_output

returns an empty string.

Is there a way that I can do this above?

I only need the output from the application start, once the application is running, I don’t need the run output.