Aqueous chemical solution deposition is a promising route for ferroelectric K0.5Na0.5NbO3 (KNN) thin films, requiring a stable precursor solution with complexed Nb5+. Here, we report on the local structure of Nb-complexes forming during synthesis of KNN using Nb5+ complexed with either oxalic or malic acid. In situ total X-ray scattering during the decomposition, pyrolysis and crystallization of KNN precursor powders using the two routes revealed information of the changes in the atomic bond distances during the thermal processing, and a reaction scheme was presented. The structures of the Nb-complexes were proposed based on cluster modelling. In situ X-ray diffraction demonstrated the crystallization of KNN thin films from the precursor solutions, revealing how the complexing agents affect the formation of crystalline KNN films. The structure of the Nb-complexes was found to influence the kinetics of the combustion of the organic part of the deposited films, which further determined the crystallization temperature.