Skip to content

Commit b42b49b

Browse files
refactor: rename workflow steps API to script steps for consistency
1 parent eb6f26a commit b42b49b

File tree

3 files changed

+25
-26
lines changed

3 files changed

+25
-26
lines changed

content/scripts/changelog.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ This page documents all changes to the NocoDB Scripts API, including new feature
99
## July 28, 2025
1010

1111

12-
#### Workflow Steps API
13-
- **Added `workflow` object** - New global object for creating visual workflow steps
14-
- **`workflow.step(config)`** - Create and start workflow steps with rich customization options
12+
#### Script Steps API
13+
- **Added `script` object** - New global object for creating visual steps
14+
- **`script.step(config)`** - Create and start steps with rich customization options
1515
- Support for titles, descriptions, icons, and colors
1616
- Automatic step management (previous step ends when new step starts)
17-
- String shorthand: `workflow.step('Step Title')` or full config object
18-
- **`workflow.clear()`** - Manually end the current workflow step
19-
- **`workflow.colors`** - Predefined color constants (red, blue, green, yellow, purple, orange, gray)
20-
- **`workflow.icons`** - Comprehensive icon library with 100+ icons across different categories.
17+
- String shorthand: `script.step('Step Title')` or full config object
18+
- **`script.clear()`** - Manually end the current step
19+
- **`script.colors`** - Predefined color constants (red, blue, green, yellow, purple, orange, gray)
20+
- **`script.icons`** - Comprehensive icon library with 100+ icons across different categories.
2121

2222

2323
#### Improvements

content/scripts/examples/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"save-view-ordering",
1313
"link-records-by-field",
1414
"unique-field-values-summary",
15-
"workflow-steps",
15+
"script-steps",
1616
"import-csv"
1717
]
1818
}

content/scripts/examples/workflow-steps.mdx renamed to content/scripts/examples/script-steps.mdx

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
---
2-
title: 'Workflow Steps Example'
3-
description: 'Example demonstrating how to use workflow steps to create visual progress tracking in scripts'
4-
icon: 'workflow'
2+
title: 'Script Steps Example'
3+
description: 'Example demonstrating how to use script steps to create visual progress tracking in scripts'
54
---
65

7-
This example demonstrates how to use the workflow API to create visual progress tracking for a data processing script. The workflow steps provide users with clear feedback about what the script is doing at each stage.
6+
This example demonstrates how to use the script API to create visual progress tracking for a data processing script. The script steps provide users with clear feedback about what the script is doing at each stage.
87

98

109
```javascript
11-
// Data Processing Script with Workflow Steps
10+
// Data Processing Script with Script Steps
1211
// This script processes customer data and generates a summary report
1312

14-
// Step 1: Initialize the workflow
15-
workflow.step({
13+
// Step 1: Initialize the script step
14+
script.step({
1615
title: 'Initializing Data Processing',
1716
description: 'Setting up the data processing pipeline',
1817
icon: 'database',
@@ -24,7 +23,7 @@ const customerTable = await input.tableAsync('Select the customer table to proce
2423
const orderTable = await input.tableAsync('Select the orders table:');
2524

2625
// Step 2: Data validation
27-
workflow.step({
26+
script.step({
2827
title: 'Validating Data Structure',
2928
description: 'Checking table structure and field compatibility',
3029
icon: 'checkCircle',
@@ -46,7 +45,7 @@ const missingOrderFields = requiredOrderFields.filter(field =>
4645
);
4746

4847
if (missingCustomerFields.length > 0 || missingOrderFields.length > 0) {
49-
workflow.step({
48+
script.step({
5049
title: 'Validation Failed',
5150
description: 'Required fields are missing from the selected tables',
5251
icon: 'xCircle',
@@ -64,7 +63,7 @@ if (missingCustomerFields.length > 0 || missingOrderFields.length > 0) {
6463
}
6564

6665
// Step 3: Fetch customer data
67-
workflow.step({
66+
script.step({
6867
title: 'Loading Customer Data',
6968
description: 'Retrieving all customer records from the database',
7069
icon: 'users',
@@ -79,7 +78,7 @@ const customers = await customerTable.selectRecordsAsync({
7978
output.text(`📊 Loaded ${customers.records.length} customer records`);
8079

8180
// Step 4: Fetch order data
82-
workflow.step({
81+
script.step({
8382
title: 'Loading Order Data',
8483
description: 'Retrieving order history for analysis',
8584
icon: 'package',
@@ -94,7 +93,7 @@ const orders = await orderTable.selectRecordsAsync({
9493
output.text(`📦 Loaded ${orders.records.length} order records`);
9594

9695
// Step 5: Process and analyze data
97-
workflow.step({
96+
script.step({
9897
title: 'Analyzing Customer Data',
9998
description: 'Calculating customer metrics and order statistics',
10099
icon: 'analytics',
@@ -127,7 +126,7 @@ const customerAnalysis = customers.records.map(customer => {
127126
});
128127

129128
// Step 6: Generate insights
130-
workflow.step({
129+
script.step({
131130
title: 'Generating Insights',
132131
description: 'Creating summary statistics and identifying trends',
133132
icon: 'lightbulb',
@@ -146,7 +145,7 @@ const topCustomers = customerAnalysis
146145
.slice(0, 5);
147146

148147
// Step 7: Generate report
149-
workflow.step({
148+
script.step({
150149
title: 'Generating Report',
151150
description: 'Creating formatted summary report',
152151
icon: 'fileText',
@@ -177,7 +176,7 @@ output.table(topCustomers.map(customer => ({
177176
})));
178177

179178
// Step 8: Completion
180-
workflow.step({
179+
script.step({
181180
title: 'Analysis Complete',
182181
description: 'Customer data analysis has been successfully completed',
183182
icon: 'checkCircle',
@@ -194,7 +193,7 @@ const shouldExport = await input.buttonsAsync(
194193
);
195194

196195
if (shouldExport) {
197-
workflow.step({
196+
script.step({
198197
title: 'Exporting Data',
199198
description: 'Preparing CSV export of customer analysis',
200199
icon: 'download',
@@ -207,8 +206,8 @@ if (shouldExport) {
207206
output.code(JSON.stringify(customerAnalysis.slice(0, 3), null, 2), 'json');
208207
}
209208

210-
// Clear the workflow
211-
workflow.clear();
209+
// Clear the script steps
210+
script.clear();
212211

213212
output.markdown(`
214213
---

0 commit comments

Comments
 (0)