The birth environment of the Sun will have influenced the physical and chemical structure of the pre-solar nebula, including the attainable chemical complexity reached in the disk, important for prebiotic chemistry. The formation and distribution of complex organic molecules (COMs) in a disk around a T Tauri star is investigated for two scenarios: (i) an isolated disk, and (ii) a disk irradiated externally by a nearby massive star. The chemistry is calculated along the accretion flow from the outer disk inwards using a comprehensive network which includes gas-phase reactions, gas-grain interactions, and thermal grain-surface chemistry. Two simulations are performed, one beginning with complex ices and one with simple ices only. For the isolated disk, COMs are transported without major chemical alteration into the inner disk where they thermally desorb into the gas reaching an abundance representative of the initial assumed ice abundance. For simple ices, COMs can efficiently form on grain surfaces under the conditions in the outer disk. Gas-phase COMs are released into the molecular layer via photodesorption. For the irradiated disk, complex ices are also transported inwards; however, they undergo thermal processing caused by the warmer conditions in the irradiated disk which tends to reduce their abundance along the accretion flow. For simple ices, grain-surface chemistry cannot efficiently synthesise COMs in the outer disk because the necessary grain-surface radicals, which tend to be particularly volatile, are not sufficiently abundant on the grain surfaces. Gas-phase COMs are formed in the inner region of the irradiated disk via gas-phase chemistry induced by the desorption of strongly bound molecules such as methanol; hence, the abundances are not representative of the initial molecular abundances injected into the outer disk. These results suggest that the composition of comets formed in isolated disks may differ from those formed in externally irradiated disks with the latter composed of more simple ices.