After much pain, I figured out how to write Alfred workflows in Python which uses the clipboard to transform text, for, for example, reformatting a markdown table.
You can check out my repository for instructions and examples: https://github.com/willf/alfred-scripts
Feel free to suggest additional scripts! Or tell me an even better way to do it.