Grid computing is emerging as a key enabling infrastructure for science. A key challenge for distributed computation over the Grid is the on-demand synthesis of large-scale, end-to-end scientific applications that draw from pools of specialized scientific components to derive elaborate new results. Many technical issues must be addressed to meet this challenge, including usability, robustness, and scale. The Pegasus system generates executable grid workflows given highly specified desired results. Pegasus uses AI planning techniques to compose valid end-to-end workflows and has been used in several scientific applications.