@Override
        public void run() {
            StatefulContext ctx = new StatefulContext();

            flow.start(ctx);
//      This is not required when using SyncExecutor
//      By the time we get here, flow is already completed
//      SyncExecutor runs on the same thread on which "start" is called
            ctx.awaitTermination();
            System.out.println("Run method completed");

            if (runningInstances.decrementAndGet() == 0) {
                System.out.println("All threads completed");
                executor.shutdownNow();
                System.exit(0);
            }
        }