Subflows

Closes #418