LLM workflow optimization