Hi,
You will need to check whether there is a tax treaty between your country of resident and the UK,as this will determine what is taxable.
You can find a list of tax treaties at:
Tax treaties
Where there is no tax treaty, the income is taxable in the UK, as it arises here, whether you are resident in the UK or not.
When you are in the UK and undertaking this work, then the income arising while in the UK is taxable in the UK.
Thank you.