Embedding process

Fixes #4023 

@SimonSapin @jdm