Sessions and pipelines for structured service programming