Adaptive Multi-Agent Reasoning via Automated Workflow Generation