Can I attach a listener to workflow execution?

If retry continues to fail I need to change order status and run some logic.

I think you can do this with your workflow business logic. After activity retries are exhausted you can catch ActivityFailure in your workflow code, and handle it accordingly (for example run some compensation activities as your logic, or even continueAsNew as a new workflow run if you wanted). Also it sounds as you are polling an external service for results, see this forum thread for best practices for polling (and we are atm creating Java samples for each described options, will link here when that’s done).