Nature of inflows and outflows in AGNs