Task and workflow framework