···123123124124## Utilities
125125126126-### Grouping
126126+### Group
127127128128Grouping prompts together is a great way to keep your code organized. This accepts a JSON object with a name that can be used to reference the group later. The second argument is an optional but has a `onCancel` callback that will be called if the user cancels one of the prompts in the group.
129129···157157console.log(group.name, group.age, group.color);
158158```
159159160160-### Building
160160+### Workflow
161161162162-Just like `group`, but on `builder` way, so you can choose which one fits better.
162162+Just like `group`, but on builder way, so you can choose which one fits better.
163163164164```js
165165import * as p from '@clack/prompts';
166166167167const results = await p
168168- .builder()
169169- .add('name', () => p.text({ message: 'What is your name?' }))
170170- .add('age', () => p.text({ message: 'What is your age?' }))
171171- .add('color', ({ results }) =>
168168+ .workflow()
169169+ .step('name', () => p.text({ message: 'What is your name?' }))
170170+ .step('age', () => p.text({ message: 'What is your age?' }))
171171+ .step('color', ({ results }) =>
172172 p.multiselect({
173173 message: `What is your favorite color ${results.name}?`,
174174 options: [
···179179 })
180180 )
181181 .onCancel(() => {
182182- p.cancel('Builder canceled');
182182+ p.cancel('Workflow canceled');
183183 process.exit(0);
184184 })
185185 .run();